From: Christian Grothoff Date: Thu, 5 Dec 2013 22:42:20 +0000 (+0000) Subject: -fix leak, indentation, make start_cb static X-Git-Tag: initial-import-from-subversion-38251~5718 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1287db0000e5f00c3ad9ee8327ba4404d6c2f8b0;p=oweals%2Fgnunet.git -fix leak, indentation, make start_cb static --- 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) GNUNET_assert (p2 == NULL); } + static void notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *message) @@ -304,31 +305,29 @@ testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls) } - -void +static void start_cb (struct PeerContext *p, void *cls) { static int started; started++; - - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%s') started\n", p->no, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Peer %u (`%s') started\n", p->no, GNUNET_i2s (&p->id)); - if (started != 2) return; - char *sender_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test tries to connect peer %u (`%s') -> peer %u (`%s')\n", p1->no, sender_c, p2->no, GNUNET_i2s (&p2->id)); - + GNUNET_free (sender_c); cc = GNUNET_TRANSPORT_TESTING_connect_peers (tth, p1, p2, &testing_connect_cb, NULL); } + static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)