diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-05 22:42:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-05 22:42:20 +0000 |
commit | 1287db0000e5f00c3ad9ee8327ba4404d6c2f8b0 (patch) | |
tree | fcb10db8cd384e9d61adb872acad5d53f4d8e8c1 /src/transport/test_transport_api_disconnect.c | |
parent | 3840406bf507bebebd1961ae818f7988b411e708 (diff) | |
download | gnunet-1287db0000e5f00c3ad9ee8327ba4404d6c2f8b0.tar.gz gnunet-1287db0000e5f00c3ad9ee8327ba4404d6c2f8b0.zip |
-fix leak, indentation, make start_cb static
Diffstat (limited to 'src/transport/test_transport_api_disconnect.c')
-rw-r--r-- | src/transport/test_transport_api_disconnect.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c index 78253d9c5..24eaa9f71 100644 --- a/src/transport/test_transport_api_disconnect.c +++ b/src/transport/test_transport_api_disconnect.c | |||
@@ -177,6 +177,7 @@ stop_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
177 | GNUNET_assert (p2 == NULL); | 177 | GNUNET_assert (p2 == NULL); |
178 | } | 178 | } |
179 | 179 | ||
180 | |||
180 | static void | 181 | static void |
181 | notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | 182 | notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, |
182 | const struct GNUNET_MessageHeader *message) | 183 | const struct GNUNET_MessageHeader *message) |
@@ -304,31 +305,29 @@ testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls) | |||
304 | } | 305 | } |
305 | 306 | ||
306 | 307 | ||
307 | 308 | static void | |
308 | void | ||
309 | start_cb (struct PeerContext *p, void *cls) | 309 | start_cb (struct PeerContext *p, void *cls) |
310 | { | 310 | { |
311 | static int started; | 311 | static int started; |
312 | 312 | ||
313 | started++; | 313 | started++; |
314 | 314 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | |
315 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%s') started\n", p->no, | 315 | "Peer %u (`%s') started\n", p->no, |
316 | GNUNET_i2s (&p->id)); | 316 | GNUNET_i2s (&p->id)); |
317 | |||
318 | if (started != 2) | 317 | if (started != 2) |
319 | return; | 318 | return; |
320 | |||
321 | char *sender_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); | 319 | char *sender_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); |
322 | 320 | ||
323 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 321 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
324 | "Test tries to connect peer %u (`%s') -> peer %u (`%s')\n", | 322 | "Test tries to connect peer %u (`%s') -> peer %u (`%s')\n", |
325 | p1->no, sender_c, p2->no, GNUNET_i2s (&p2->id)); | 323 | p1->no, sender_c, p2->no, GNUNET_i2s (&p2->id)); |
326 | 324 | GNUNET_free (sender_c); | |
327 | cc = GNUNET_TRANSPORT_TESTING_connect_peers (tth, p1, p2, &testing_connect_cb, | 325 | cc = GNUNET_TRANSPORT_TESTING_connect_peers (tth, p1, p2, &testing_connect_cb, |
328 | NULL); | 326 | NULL); |
329 | 327 | ||
330 | } | 328 | } |
331 | 329 | ||
330 | |||
332 | static void | 331 | static void |
333 | run (void *cls, char *const *args, const char *cfgfile, | 332 | run (void *cls, char *const *args, const char *cfgfile, |
334 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 333 | const struct GNUNET_CONFIGURATION_Handle *cfg) |