aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_api_reliability.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-06-20 09:34:27 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-06-20 09:34:27 +0000
commit4689e6e012bb19c206dd6c2600ef107166107706 (patch)
tree3d443fc042443b21cd4186342d1e207bb5cb3beb /src/transport/test_transport_api_reliability.c
parentaa31762d4d370596a22f78096401a6410aaf1b8b (diff)
downloadgnunet-4689e6e012bb19c206dd6c2600ef107166107706.tar.gz
gnunet-4689e6e012bb19c206dd6c2600ef107166107706.zip
Diffstat (limited to 'src/transport/test_transport_api_reliability.c')
-rw-r--r--src/transport/test_transport_api_reliability.c19
1 files changed, 16 insertions, 3 deletions
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;
101static int msg_recv_expected; 101static int msg_recv_expected;
102static int msg_recv; 102static int msg_recv;
103 103
104static int p1_hello_canceled;
105static int p2_hello_canceled;
106
104#if VERBOSE 107#if VERBOSE
105#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) 108#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
106#else 109#else
@@ -428,10 +431,18 @@ notify_connect (void *cls,
428 if (die_task != GNUNET_SCHEDULER_NO_TASK) 431 if (die_task != GNUNET_SCHEDULER_NO_TASK)
429 GNUNET_SCHEDULER_cancel (die_task); 432 GNUNET_SCHEDULER_cancel (die_task);
430 if (tct != GNUNET_SCHEDULER_NO_TASK) 433 if (tct != GNUNET_SCHEDULER_NO_TASK)
431 GNUNET_SCHEDULER_cancel (tct); 434 GNUNET_SCHEDULER_cancel (tct);
432 tct = GNUNET_SCHEDULER_NO_TASK; 435 tct = GNUNET_SCHEDULER_NO_TASK;
433 GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, &p2); 436 if (p2_hello_canceled == GNUNET_NO)
434 GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, &p1); 437 {
438 GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, &p2);
439 p2_hello_canceled = GNUNET_YES;
440 }
441 if (p1_hello_canceled == GNUNET_NO)
442 {
443 GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, &p1);
444 p1_hello_canceled = GNUNET_YES;
445 }
435 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, 446 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
436 &end_badly, NULL); 447 &end_badly, NULL);
437 th_p2 = GNUNET_TRANSPORT_notify_transmit_ready (p2.th, 448 th_p2 = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
@@ -722,7 +733,9 @@ run (void *cls,
722 GNUNET_assert(p1.th != NULL); 733 GNUNET_assert(p1.th != NULL);
723 GNUNET_assert(p2.th != NULL); 734 GNUNET_assert(p2.th != NULL);
724 GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1); 735 GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1);
736 p1_hello_canceled = GNUNET_NO;
725 GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2); 737 GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2);
738 p2_hello_canceled = GNUNET_NO;
726 tct = GNUNET_SCHEDULER_add_now (&try_connect, NULL); 739 tct = GNUNET_SCHEDULER_add_now (&try_connect, NULL);
727} 740}
728 741