From 7654fc4f50812076c2f1374ac95af49db945a8b3 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 8 Nov 2012 12:14:38 +0000 Subject: [PATCH] - changes --- src/transport/gnunet-transport.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 19abda0ea..a4fb227cc 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c @@ -456,7 +456,11 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, ret = 0; if (try_connect) { - /*FIXME */ + /* all done, terminate instantly */ + if (verbosity > 0) + FPRINTF (stdout, _("Successfully connected to %s\n"), GNUNET_i2s (peer)); + GNUNET_SCHEDULER_cancel (end); + end = GNUNET_SCHEDULER_add_now (&do_disconnect, NULL); } else if (benchmark_send) { @@ -700,6 +704,12 @@ testservice_task (void *cls, ¬ify_receive, ¬ify_connect, ¬ify_disconnect); + if (NULL == handle) + { + FPRINTF (stderr, _("Failed to connect to transport service\n")); + return; + } + GNUNET_TRANSPORT_try_connect (handle, &pid); } @@ -716,6 +726,11 @@ testservice_task (void *cls, ¬ify_receive, ¬ify_connect, ¬ify_disconnect); + if (NULL == handle) + { + FPRINTF (stderr, _("Failed to connect to transport service\n")); + return; + } GNUNET_TRANSPORT_try_connect (handle, &pid); end = GNUNET_SCHEDULER_add_delayed (benchmark_send ? GNUNET_TIME_UNIT_FOREVER_REL : @@ -728,6 +743,11 @@ testservice_task (void *cls, handle = GNUNET_TRANSPORT_connect (cfg, NULL, NULL, ¬ify_receive, ¬ify_connect, ¬ify_disconnect); + if (NULL == handle) + { + FPRINTF (stderr, _("Failed to connect to transport service\n")); + return; + } GNUNET_TRANSPORT_try_connect (handle, &pid); start_time = GNUNET_TIME_absolute_get (); end = @@ -760,7 +780,7 @@ testservice_task (void *cls, &monitor_notify_disconnect); if (NULL == handle) { - GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); + FPRINTF (stderr, _("Failed to connect to transport service\n")); return; } } -- 2.25.1