diff options
Diffstat (limited to 'src/transport/test_transport_startonly.c')
-rw-r--r-- | src/transport/test_transport_startonly.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/transport/test_transport_startonly.c b/src/transport/test_transport_startonly.c index 89ada4c01..730d7946c 100644 --- a/src/transport/test_transport_startonly.c +++ b/src/transport/test_transport_startonly.c | |||
@@ -54,6 +54,8 @@ GNUNET_SCHEDULER_TaskIdentifier timeout_task; | |||
54 | 54 | ||
55 | static struct PeerContext *p1; | 55 | static struct PeerContext *p1; |
56 | 56 | ||
57 | struct TransportTestingHandle * tth; | ||
58 | |||
57 | static int connected = GNUNET_NO; | 59 | static int connected = GNUNET_NO; |
58 | 60 | ||
59 | static int ret = 0; | 61 | static int ret = 0; |
@@ -83,7 +85,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
83 | return; | 85 | return; |
84 | 86 | ||
85 | if (p1 != NULL) | 87 | if (p1 != NULL) |
86 | GNUNET_TRANSPORT_TESTING_stop_peer (p1); | 88 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1); |
87 | 89 | ||
88 | ret = GNUNET_SYSERR; | 90 | ret = GNUNET_SYSERR; |
89 | } | 91 | } |
@@ -119,6 +121,8 @@ static void | |||
119 | run (void *cls, char *const *args, const char *cfgfile, | 121 | run (void *cls, char *const *args, const char *cfgfile, |
120 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 122 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
121 | { | 123 | { |
124 | tth = GNUNET_TRANSPORT_TESTING_init (); | ||
125 | |||
122 | timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); | 126 | timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); |
123 | 127 | ||
124 | i = 1; | 128 | i = 1; |
@@ -126,9 +130,9 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
126 | while (i <= ITERATIONS) | 130 | while (i <= ITERATIONS) |
127 | { | 131 | { |
128 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting peer\n"); | 132 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting peer\n"); |
129 | p1 = GNUNET_TRANSPORT_TESTING_start_peer ("test_transport_startonly.conf", | 133 | p1 = GNUNET_TRANSPORT_TESTING_start_peer (tth, "test_transport_startonly.conf", 1, |
130 | ¬ify_receive, ¬ify_connect, | 134 | ¬ify_receive, ¬ify_connect, |
131 | ¬ify_disconnect, p1); | 135 | ¬ify_disconnect, NULL, p1); |
132 | 136 | ||
133 | 137 | ||
134 | if (p1 != NULL) | 138 | if (p1 != NULL) |
@@ -139,14 +143,15 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
139 | GNUNET_assert (p1 != NULL); | 143 | GNUNET_assert (p1 != NULL); |
140 | GNUNET_assert (p1->th != NULL); | 144 | GNUNET_assert (p1->th != NULL); |
141 | 145 | ||
142 | //sleep (5); | 146 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1); |
143 | |||
144 | GNUNET_TRANSPORT_TESTING_stop_peer (p1); | ||
145 | 147 | ||
146 | i++; | 148 | i++; |
147 | if (i <= ITERATIONS) | 149 | if (i <= ITERATIONS) |
148 | fprintf (stderr, "..%i", i); | 150 | fprintf (stderr, "..%i", i); |
149 | } | 151 | } |
152 | |||
153 | GNUNET_TRANSPORT_TESTING_init (tth); | ||
154 | |||
150 | fprintf (stderr, "\n"); | 155 | fprintf (stderr, "\n"); |
151 | end (); | 156 | end (); |
152 | } | 157 | } |