From 4689e6e012bb19c206dd6c2600ef107166107706 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Mon, 20 Jun 2011 09:34:27 +0000 Subject: --- src/transport/test_transport_api_reliability.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c index 50a9cc80e..4af8a24f9 100644 --- a/src/transport/test_transport_api_reliability.c +++ b/src/transport/test_transport_api_reliability.c @@ -101,6 +101,9 @@ static int msg_sent; static int msg_recv_expected; static int msg_recv; +static int p1_hello_canceled; +static int p2_hello_canceled; + #if VERBOSE #define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else @@ -428,10 +431,18 @@ notify_connect (void *cls, if (die_task != GNUNET_SCHEDULER_NO_TASK) GNUNET_SCHEDULER_cancel (die_task); if (tct != GNUNET_SCHEDULER_NO_TASK) - GNUNET_SCHEDULER_cancel (tct); + GNUNET_SCHEDULER_cancel (tct); tct = GNUNET_SCHEDULER_NO_TASK; - GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, &p2); - GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, &p1); + if (p2_hello_canceled == GNUNET_NO) + { + GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, &p2); + p2_hello_canceled = GNUNET_YES; + } + if (p1_hello_canceled == GNUNET_NO) + { + GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, &p1); + p1_hello_canceled = GNUNET_YES; + } die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); th_p2 = GNUNET_TRANSPORT_notify_transmit_ready (p2.th, @@ -722,7 +733,9 @@ run (void *cls, GNUNET_assert(p1.th != NULL); GNUNET_assert(p2.th != NULL); GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1); + p1_hello_canceled = GNUNET_NO; GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2); + p2_hello_canceled = GNUNET_NO; tct = GNUNET_SCHEDULER_add_now (&try_connect, NULL); } -- cgit v1.2.3