diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-11-04 14:00:32 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-11-04 14:00:32 +0000 |
commit | 83b19539f4d322b43683f5838b72e9ec2c8e6073 (patch) | |
tree | d0ab9329fcbefe360d9d14e2ace21a6b3396dfe9 /src/transport/transport-testing.c | |
parent | 28a2eb43281a1f08a67954f07beb9af3a9bc9a35 (diff) | |
download | gnunet-83b19539f4d322b43683f5838b72e9ec2c8e6073.tar.gz gnunet-83b19539f4d322b43683f5838b72e9ec2c8e6073.zip |
curly wars / auto-indentation
Diffstat (limited to 'src/transport/transport-testing.c')
-rw-r--r-- | src/transport/transport-testing.c | 134 |
1 files changed, 70 insertions, 64 deletions
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index a4eba609d..b23879032 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c | |||
@@ -31,11 +31,11 @@ | |||
31 | 31 | ||
32 | 32 | ||
33 | static struct PeerContext * | 33 | static struct PeerContext * |
34 | find_peer_context ( struct GNUNET_TRANSPORT_TESTING_handle *tth, | 34 | find_peer_context (struct GNUNET_TRANSPORT_TESTING_handle *tth, |
35 | const struct GNUNET_PeerIdentity *peer) | 35 | const struct GNUNET_PeerIdentity *peer) |
36 | { | 36 | { |
37 | GNUNET_assert (tth != NULL); | 37 | GNUNET_assert (tth != NULL); |
38 | struct PeerContext * t = tth->p_head; | 38 | struct PeerContext *t = tth->p_head; |
39 | 39 | ||
40 | while (t != NULL) | 40 | while (t != NULL) |
41 | { | 41 | { |
@@ -48,17 +48,16 @@ find_peer_context ( struct GNUNET_TRANSPORT_TESTING_handle *tth, | |||
48 | } | 48 | } |
49 | 49 | ||
50 | struct ConnectingContext * | 50 | struct ConnectingContext * |
51 | find_connecting_context ( struct GNUNET_TRANSPORT_TESTING_handle *tth, | 51 | find_connecting_context (struct GNUNET_TRANSPORT_TESTING_handle *tth, |
52 | struct PeerContext *p1, | 52 | struct PeerContext *p1, struct PeerContext *p2) |
53 | struct PeerContext * p2) | ||
54 | { | 53 | { |
55 | GNUNET_assert (tth != NULL); | 54 | GNUNET_assert (tth != NULL); |
56 | struct ConnectingContext * cc = tth->cc_head; | 55 | struct ConnectingContext *cc = tth->cc_head; |
57 | 56 | ||
58 | while (cc != NULL) | 57 | while (cc != NULL) |
59 | { | 58 | { |
60 | if ((cc->p1 == p1) && (cc->p2 == p2)) | 59 | if ((cc->p1 == p1) && (cc->p2 == p2)) |
61 | break; | 60 | break; |
62 | if ((cc->p1 == p2) && (cc->p2 == p1)) | 61 | if ((cc->p1 == p2) && (cc->p2 == p1)) |
63 | break; | 62 | break; |
64 | cc = cc->next; | 63 | cc = cc->next; |
@@ -69,14 +68,14 @@ find_connecting_context ( struct GNUNET_TRANSPORT_TESTING_handle *tth, | |||
69 | 68 | ||
70 | static void | 69 | static void |
71 | notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | 70 | notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, |
72 | const struct GNUNET_ATS_Information *ats, | 71 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) |
73 | uint32_t ats_count) | ||
74 | { | 72 | { |
75 | struct PeerContext *p = cls; | 73 | struct PeerContext *p = cls; |
74 | |||
76 | /* Find PeerContext */ | 75 | /* Find PeerContext */ |
77 | GNUNET_assert (p != 0); | 76 | GNUNET_assert (p != 0); |
78 | GNUNET_assert (p->tth != NULL); | 77 | GNUNET_assert (p->tth != NULL); |
79 | struct PeerContext * p2 = find_peer_context (p->tth, peer); | 78 | struct PeerContext *p2 = find_peer_context (p->tth, peer); |
80 | 79 | ||
81 | if (p == NULL) | 80 | if (p == NULL) |
82 | return; | 81 | return; |
@@ -84,21 +83,22 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
84 | p->nc (p->cb_cls, peer, ats, ats_count); | 83 | p->nc (p->cb_cls, peer, ats, ats_count); |
85 | 84 | ||
86 | #if VERBOSE | 85 | #if VERBOSE |
87 | char * p2_s; | 86 | char *p2_s; |
87 | |||
88 | if (p2 != NULL) | 88 | if (p2 != NULL) |
89 | GNUNET_asprintf(&p2_s, "%u (`%s')", p2->no, GNUNET_i2s (&p2->id)); | 89 | GNUNET_asprintf (&p2_s, "%u (`%s')", p2->no, GNUNET_i2s (&p2->id)); |
90 | else | 90 | else |
91 | GNUNET_asprintf(&p2_s, "`%s'", GNUNET_i2s (peer)); | 91 | GNUNET_asprintf (&p2_s, "`%s'", GNUNET_i2s (peer)); |
92 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", | 92 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", |
93 | "Peers %s connected to peer %u (`%s')\n", | 93 | "Peers %s connected to peer %u (`%s')\n", p2_s, p->no, |
94 | p2_s, | 94 | GNUNET_i2s (&p->id)); |
95 | p->no, GNUNET_i2s (&p->id)); | ||
96 | GNUNET_free (p2_s); | 95 | GNUNET_free (p2_s); |
97 | #endif | 96 | #endif |
98 | 97 | ||
99 | 98 | ||
100 | /* Find ConnectingContext */ | 99 | /* Find ConnectingContext */ |
101 | struct ConnectingContext * cc = find_connecting_context(p->tth, p, p2); | 100 | struct ConnectingContext *cc = find_connecting_context (p->tth, p, p2); |
101 | |||
102 | if (cc == NULL) | 102 | if (cc == NULL) |
103 | return; | 103 | return; |
104 | 104 | ||
@@ -106,12 +106,12 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
106 | cc->p1_c = GNUNET_YES; | 106 | cc->p1_c = GNUNET_YES; |
107 | 107 | ||
108 | if (p == cc->p2) | 108 | if (p == cc->p2) |
109 | cc->p2_c = GNUNET_YES; | 109 | cc->p2_c = GNUNET_YES; |
110 | 110 | ||
111 | if ((cc->p1_c == GNUNET_YES) && (cc->p2_c == GNUNET_YES)) | 111 | if ((cc->p1_c == GNUNET_YES) && (cc->p2_c == GNUNET_YES)) |
112 | { | 112 | { |
113 | cc->cb (cc->p1, cc->p2, cc->cb_cls); | 113 | cc->cb (cc->p1, cc->p2, cc->cb_cls); |
114 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel(p->tth, cc); | 114 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (p->tth, cc); |
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
@@ -119,9 +119,10 @@ static void | |||
119 | notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | 119 | notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) |
120 | { | 120 | { |
121 | struct PeerContext *p = cls; | 121 | struct PeerContext *p = cls; |
122 | |||
122 | /* Find PeerContext */ | 123 | /* Find PeerContext */ |
123 | int no = 0; | 124 | int no = 0; |
124 | struct PeerContext * p2 = NULL; | 125 | struct PeerContext *p2 = NULL; |
125 | 126 | ||
126 | if (p != NULL) | 127 | if (p != NULL) |
127 | { | 128 | { |
@@ -130,15 +131,15 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
130 | no = p->no; | 131 | no = p->no; |
131 | } | 132 | } |
132 | 133 | ||
133 | char * p2_s; | 134 | char *p2_s; |
135 | |||
134 | if (p2 != NULL) | 136 | if (p2 != NULL) |
135 | GNUNET_asprintf(&p2_s, "%u (`%s')", p2->no, GNUNET_i2s (&p2->id)); | 137 | GNUNET_asprintf (&p2_s, "%u (`%s')", p2->no, GNUNET_i2s (&p2->id)); |
136 | else | 138 | else |
137 | GNUNET_asprintf(&p2_s, "`%s'", GNUNET_i2s (peer)); | 139 | GNUNET_asprintf (&p2_s, "`%s'", GNUNET_i2s (peer)); |
138 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", | 140 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", |
139 | "Peers %s disconnected from peer %u (`%s')\n", | 141 | "Peers %s disconnected from peer %u (`%s')\n", p2_s, no, |
140 | p2_s, | 142 | GNUNET_i2s (&p->id)); |
141 | no , GNUNET_i2s (&p->id)); | ||
142 | GNUNET_free (p2_s); | 143 | GNUNET_free (p2_s); |
143 | 144 | ||
144 | if (p == NULL) | 145 | if (p == NULL) |
@@ -150,8 +151,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
150 | static void | 151 | static void |
151 | notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | 152 | notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, |
152 | const struct GNUNET_MessageHeader *message, | 153 | const struct GNUNET_MessageHeader *message, |
153 | const struct GNUNET_ATS_Information *ats, | 154 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) |
154 | uint32_t ats_count) | ||
155 | { | 155 | { |
156 | struct PeerContext *p = cls; | 156 | struct PeerContext *p = cls; |
157 | 157 | ||
@@ -170,25 +170,25 @@ get_hello (void *cb_cls, const struct GNUNET_MessageHeader *message) | |||
170 | GNUNET_assert (GNUNET_OK == | 170 | GNUNET_assert (GNUNET_OK == |
171 | GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) | 171 | GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) |
172 | message, &p->id)); | 172 | message, &p->id)); |
173 | size_t size = GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *) message); | 173 | size_t size = |
174 | GNUNET_HELLO_size ((const struct GNUNET_HELLO_Message *) message); | ||
174 | GNUNET_free_non_null (p->hello); | 175 | GNUNET_free_non_null (p->hello); |
175 | p->hello = (struct GNUNET_HELLO_Message*) GNUNET_copy_message (message); | 176 | p->hello = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (message); |
176 | 177 | ||
177 | #if VERBOSE | 178 | #if VERBOSE |
178 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, | 179 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", |
179 | "transport-testing", | 180 | "New HELLO for peer %u (`%s') with size %u\n", p->no, |
180 | "New HELLO for peer %u (`%s') with size %u\n", | 181 | GNUNET_i2s (&p->id), size); |
181 | p->no, GNUNET_i2s (&p->id), size); | ||
182 | #endif | 182 | #endif |
183 | 183 | ||
184 | if (p->start_cb != NULL) | 184 | if (p->start_cb != NULL) |
185 | { | 185 | { |
186 | #if VERBOSE | 186 | #if VERBOSE |
187 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", | 187 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", |
188 | "Peer %u (`%s') successfully started\n", | 188 | "Peer %u (`%s') successfully started\n", p->no, |
189 | p->no, GNUNET_i2s (&p->id)); | 189 | GNUNET_i2s (&p->id)); |
190 | #endif | 190 | #endif |
191 | p->start_cb(p, p->cb_cls); | 191 | p->start_cb (p, p->cb_cls); |
192 | p->start_cb = NULL; | 192 | p->start_cb = NULL; |
193 | } | 193 | } |
194 | } | 194 | } |
@@ -205,15 +205,17 @@ try_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
205 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) | 205 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) |
206 | return; | 206 | return; |
207 | 207 | ||
208 | char * p2_s = GNUNET_strdup(GNUNET_i2s (&p2->id)); | 208 | char *p2_s = GNUNET_strdup (GNUNET_i2s (&p2->id)); |
209 | |||
209 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", | 210 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", |
210 | "Asking peer %u (`%s') to connect peer %u (`%s'), providing HELLO with %u bytes\n", | 211 | "Asking peer %u (`%s') to connect peer %u (`%s'), providing HELLO with %u bytes\n", |
211 | p1->no, GNUNET_i2s (&p1->id), p2->no, p2_s, | 212 | p1->no, GNUNET_i2s (&p1->id), p2->no, p2_s, |
212 | GNUNET_HELLO_size (cc->p2->hello)); | 213 | GNUNET_HELLO_size (cc->p2->hello)); |
213 | GNUNET_free (p2_s); | 214 | GNUNET_free (p2_s); |
214 | 215 | ||
215 | GNUNET_TRANSPORT_offer_hello (cc->th_p1, | 216 | GNUNET_TRANSPORT_offer_hello (cc->th_p1, |
216 | (const struct GNUNET_MessageHeader *) cc->p2->hello, NULL, NULL); | 217 | (const struct GNUNET_MessageHeader *) cc-> |
218 | p2->hello, NULL, NULL); | ||
217 | GNUNET_TRANSPORT_try_connect (cc->th_p1, &p2->id); | 219 | GNUNET_TRANSPORT_try_connect (cc->th_p1, &p2->id); |
218 | 220 | ||
219 | cc->tct = | 221 | cc->tct = |
@@ -230,9 +232,8 @@ try_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
230 | * @return the peer context | 232 | * @return the peer context |
231 | */ | 233 | */ |
232 | struct PeerContext * | 234 | struct PeerContext * |
233 | GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle * tth, | 235 | GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle |
234 | const char *cfgname, | 236 | *tth, const char *cfgname, int peer_id, |
235 | int peer_id, | ||
236 | GNUNET_TRANSPORT_ReceiveCallback rec, | 237 | GNUNET_TRANSPORT_ReceiveCallback rec, |
237 | GNUNET_TRANSPORT_NotifyConnect nc, | 238 | GNUNET_TRANSPORT_NotifyConnect nc, |
238 | GNUNET_TRANSPORT_NotifyDisconnect nd, | 239 | GNUNET_TRANSPORT_NotifyDisconnect nd, |
@@ -243,7 +244,7 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle * tt | |||
243 | if (GNUNET_DISK_file_test (cfgname) == GNUNET_NO) | 244 | if (GNUNET_DISK_file_test (cfgname) == GNUNET_NO) |
244 | { | 245 | { |
245 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "transport-testing", | 246 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "transport-testing", |
246 | "File not found: `%s' \n", cfgname); | 247 | "File not found: `%s' \n", cfgname); |
247 | return NULL; | 248 | return NULL; |
248 | } | 249 | } |
249 | 250 | ||
@@ -253,8 +254,10 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle * tt | |||
253 | 254 | ||
254 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 255 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
255 | if (GNUNET_CONFIGURATION_have_value (p->cfg, "PATHS", "SERVICEHOME")) | 256 | if (GNUNET_CONFIGURATION_have_value (p->cfg, "PATHS", "SERVICEHOME")) |
256 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (p->cfg, "PATHS", "SERVICEHOME", | 257 | GNUNET_assert (GNUNET_OK == |
257 | &p->servicehome)); | 258 | GNUNET_CONFIGURATION_get_value_string (p->cfg, "PATHS", |
259 | "SERVICEHOME", | ||
260 | &p->servicehome)); | ||
258 | if (NULL != p->servicehome) | 261 | if (NULL != p->servicehome) |
259 | GNUNET_DISK_directory_remove (p->servicehome); | 262 | GNUNET_DISK_directory_remove (p->servicehome); |
260 | p->arm_proc = | 263 | p->arm_proc = |
@@ -286,7 +289,7 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle * tt | |||
286 | p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &get_hello, p); | 289 | p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &get_hello, p); |
287 | GNUNET_assert (p->ghh != NULL); | 290 | GNUNET_assert (p->ghh != NULL); |
288 | 291 | ||
289 | GNUNET_CONTAINER_DLL_insert(tth->p_head, tth->p_tail, p); | 292 | GNUNET_CONTAINER_DLL_insert (tth->p_head, tth->p_tail, p); |
290 | 293 | ||
291 | return p; | 294 | return p; |
292 | } | 295 | } |
@@ -296,7 +299,7 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle * tt | |||
296 | * @param p the peer | 299 | * @param p the peer |
297 | */ | 300 | */ |
298 | void | 301 | void |
299 | GNUNET_TRANSPORT_TESTING_stop_peer (struct GNUNET_TRANSPORT_TESTING_handle * tth, | 302 | GNUNET_TRANSPORT_TESTING_stop_peer (struct GNUNET_TRANSPORT_TESTING_handle *tth, |
300 | struct PeerContext *p) | 303 | struct PeerContext *p) |
301 | { | 304 | { |
302 | GNUNET_assert (p != NULL); | 305 | GNUNET_assert (p != NULL); |
@@ -346,12 +349,11 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct GNUNET_TRANSPORT_TESTING_handle * tth | |||
346 | * @return connect context | 349 | * @return connect context |
347 | */ | 350 | */ |
348 | GNUNET_TRANSPORT_TESTING_ConnectRequest | 351 | GNUNET_TRANSPORT_TESTING_ConnectRequest |
349 | GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle * tth, | 352 | GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle |
350 | struct PeerContext *p1, | 353 | *tth, struct PeerContext *p1, |
351 | struct PeerContext *p2, | 354 | struct PeerContext *p2, |
352 | GNUNET_TRANSPORT_TESTING_connect_cb cb, | 355 | GNUNET_TRANSPORT_TESTING_connect_cb cb, |
353 | void *cb_cls) | 356 | void *cb_cls) |
354 | |||
355 | { | 357 | { |
356 | GNUNET_assert (tth != NULL); | 358 | GNUNET_assert (tth != NULL); |
357 | 359 | ||
@@ -377,7 +379,7 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle * | |||
377 | 379 | ||
378 | cc->tct = GNUNET_SCHEDULER_add_now (&try_connect, cc); | 380 | cc->tct = GNUNET_SCHEDULER_add_now (&try_connect, cc); |
379 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", | 381 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", |
380 | "New connect request %X\n", cc); | 382 | "New connect request %X\n", cc); |
381 | 383 | ||
382 | return cc; | 384 | return cc; |
383 | } | 385 | } |
@@ -387,16 +389,19 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle * | |||
387 | * Tou MUST cancel the request if you stop the peers before the peers connected succesfully | 389 | * Tou MUST cancel the request if you stop the peers before the peers connected succesfully |
388 | * @param cc a connect request handle | 390 | * @param cc a connect request handle |
389 | */ | 391 | */ |
390 | void GNUNET_TRANSPORT_TESTING_connect_peers_cancel | 392 | void |
391 | (struct GNUNET_TRANSPORT_TESTING_handle * tth, | 393 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct |
392 | GNUNET_TRANSPORT_TESTING_ConnectRequest ccr) | 394 | GNUNET_TRANSPORT_TESTING_handle |
395 | *tth, | ||
396 | GNUNET_TRANSPORT_TESTING_ConnectRequest | ||
397 | ccr) | ||
393 | { | 398 | { |
394 | struct ConnectingContext *cc = ccr; | 399 | struct ConnectingContext *cc = ccr; |
395 | 400 | ||
396 | GNUNET_assert (tth != NULL); | 401 | GNUNET_assert (tth != NULL); |
397 | 402 | ||
398 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", | 403 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", |
399 | "Canceling connect request %X!\n", cc); | 404 | "Canceling connect request %X!\n", cc); |
400 | if (cc->tct != GNUNET_SCHEDULER_NO_TASK) | 405 | if (cc->tct != GNUNET_SCHEDULER_NO_TASK) |
401 | GNUNET_SCHEDULER_cancel (cc->tct); | 406 | GNUNET_SCHEDULER_cancel (cc->tct); |
402 | 407 | ||
@@ -412,7 +417,7 @@ void GNUNET_TRANSPORT_TESTING_connect_peers_cancel | |||
412 | * @param tth transport testing handle | 417 | * @param tth transport testing handle |
413 | */ | 418 | */ |
414 | void | 419 | void |
415 | GNUNET_TRANSPORT_TESTING_done (struct GNUNET_TRANSPORT_TESTING_handle * tth) | 420 | GNUNET_TRANSPORT_TESTING_done (struct GNUNET_TRANSPORT_TESTING_handle *tth) |
416 | { | 421 | { |
417 | struct ConnectingContext *cc = tth->cc_head; | 422 | struct ConnectingContext *cc = tth->cc_head; |
418 | struct ConnectingContext *ct = NULL; | 423 | struct ConnectingContext *ct = NULL; |
@@ -425,8 +430,8 @@ GNUNET_TRANSPORT_TESTING_done (struct GNUNET_TRANSPORT_TESTING_handle * tth) | |||
425 | { | 430 | { |
426 | ct = cc->next; | 431 | ct = cc->next; |
427 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "transport-testing", | 432 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "transport-testing", |
428 | "Developer forgot to cancel connect request %X!\n", cc); | 433 | "Developer forgot to cancel connect request %X!\n", cc); |
429 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel(tth, cc); | 434 | GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc); |
430 | cc = ct; | 435 | cc = ct; |
431 | } | 436 | } |
432 | 437 | ||
@@ -434,7 +439,7 @@ GNUNET_TRANSPORT_TESTING_done (struct GNUNET_TRANSPORT_TESTING_handle * tth) | |||
434 | { | 439 | { |
435 | t = p->next; | 440 | t = p->next; |
436 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "transport-testing", | 441 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "transport-testing", |
437 | "Developer forgot to stop peer!\n"); | 442 | "Developer forgot to stop peer!\n"); |
438 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p); | 443 | GNUNET_TRANSPORT_TESTING_stop_peer (tth, p); |
439 | p = t; | 444 | p = t; |
440 | } | 445 | } |
@@ -450,7 +455,8 @@ GNUNET_TRANSPORT_TESTING_done (struct GNUNET_TRANSPORT_TESTING_handle * tth) | |||
450 | struct GNUNET_TRANSPORT_TESTING_handle * | 455 | struct GNUNET_TRANSPORT_TESTING_handle * |
451 | GNUNET_TRANSPORT_TESTING_init () | 456 | GNUNET_TRANSPORT_TESTING_init () |
452 | { | 457 | { |
453 | struct GNUNET_TRANSPORT_TESTING_handle * tth = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_TESTING_handle)); | 458 | struct GNUNET_TRANSPORT_TESTING_handle *tth = |
459 | GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_TESTING_handle)); | ||
454 | 460 | ||
455 | return tth; | 461 | return tth; |
456 | } | 462 | } |