aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_api_reliability.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2010-12-23 13:03:34 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2010-12-23 13:03:34 +0000
commit417167b77f6f6a904892e628824b26660ea809c7 (patch)
treecbb5325871ea66788422e97dcc2275e0f33d3244 /src/transport/test_transport_api_reliability.c
parent70b29a49e813cfa5c13be386dea57870d54e5656 (diff)
downloadgnunet-417167b77f6f6a904892e628824b26660ea809c7.tar.gz
gnunet-417167b77f6f6a904892e628824b26660ea809c7.zip
changed reliability to cancel notify_transmit_ready
Diffstat (limited to 'src/transport/test_transport_api_reliability.c')
-rw-r--r--src/transport/test_transport_api_reliability.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c
index 96e0d988d..cabc9f6e4 100644
--- a/src/transport/test_transport_api_reliability.c
+++ b/src/transport/test_transport_api_reliability.c
@@ -100,7 +100,7 @@ static int msg_scheduled;
100static int msg_sent; 100static int msg_sent;
101static int msg_recv_expected; 101static int msg_recv_expected;
102static int msg_recv; 102static int msg_recv;
103 103static struct GNUNET_TRANSPORT_TransmitHandle * transmit_handle;
104 104
105#if VERBOSE 105#if VERBOSE
106#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) 106#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
@@ -351,6 +351,11 @@ notify_connect (void *cls,
351 351
352 if (connected == 2) 352 if (connected == 2)
353 { 353 {
354
355 if ((transmit_handle!=NULL) && (cls == NULL))
356 GNUNET_TRANSPORT_notify_transmit_ready_cancel(transmit_handle);
357 if ((transmit_handle!=NULL) && (cls == &transmit_handle))
358 transmit_handle==NULL;
354 GNUNET_TRANSPORT_notify_transmit_ready (p2.th, 359 GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
355 &p1.id, 360 &p1.id,
356 get_size (0), 0, TIMEOUT, 361 get_size (0), 0, TIMEOUT,
@@ -466,7 +471,7 @@ exchange_hello_last (void *cls,
466 const struct GNUNET_MessageHeader *message) 471 const struct GNUNET_MessageHeader *message)
467{ 472{
468 struct PeerContext *me = cls; 473 struct PeerContext *me = cls;
469 474 transmit_handle = NULL;
470 GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, me); 475 GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, me);
471#if VERBOSE 476#if VERBOSE
472 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 477 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -479,12 +484,12 @@ exchange_hello_last (void *cls,
479 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) 484 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
480 message, &me->id)); 485 message, &me->id));
481 486
482 GNUNET_assert(NULL != GNUNET_TRANSPORT_notify_transmit_ready (p2.th, 487 GNUNET_assert(NULL != (transmit_handle = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
483 &p1.id, 488 &p1.id,
484 sizeof (struct GNUNET_MessageHeader), 0, 489 sizeof (struct GNUNET_MessageHeader), 0,
485 TIMEOUT, 490 TIMEOUT,
486 &notify_ready_connect, 491 &notify_ready_connect,
487 NULL)); 492 &transmit_handle)));
488 493
489 /* both HELLOs exchanged, get ready to test transmission! */ 494 /* both HELLOs exchanged, get ready to test transmission! */
490 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 495 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,