diff options
-rw-r--r-- | src/transport/gnunet-transport.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 568cf56fa..383d14d2f 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c | |||
@@ -356,7 +356,10 @@ transmit_data (void *cls, size_t size, void *buf) | |||
356 | struct GNUNET_MessageHeader *m = buf; | 356 | struct GNUNET_MessageHeader *m = buf; |
357 | 357 | ||
358 | if ((NULL == buf) && (0 == size)) | 358 | if ((NULL == buf) && (0 == size)) |
359 | { | ||
360 | th = NULL; | ||
359 | return 0; | 361 | return 0; |
362 | } | ||
360 | 363 | ||
361 | GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader)); | 364 | GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader)); |
362 | GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE); | 365 | GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE); |
@@ -395,7 +398,8 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
395 | if (benchmark_send) | 398 | if (benchmark_send) |
396 | { | 399 | { |
397 | start_time = GNUNET_TIME_absolute_get (); | 400 | start_time = GNUNET_TIME_absolute_get (); |
398 | th = GNUNET_TRANSPORT_notify_transmit_ready (handle, peer, 32 * 1024, 0, | 401 | if (NULL == th) |
402 | th = GNUNET_TRANSPORT_notify_transmit_ready (handle, peer, 32 * 1024, 0, | ||
399 | GNUNET_TIME_UNIT_FOREVER_REL, | 403 | GNUNET_TIME_UNIT_FOREVER_REL, |
400 | &transmit_data, NULL); | 404 | &transmit_data, NULL); |
401 | } | 405 | } |
@@ -585,6 +589,11 @@ static void | |||
585 | shutdown_task (void *cls, | 589 | shutdown_task (void *cls, |
586 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 590 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
587 | { | 591 | { |
592 | if (NULL != th) | ||
593 | { | ||
594 | GNUNET_TRANSPORT_notify_transmit_ready_cancel(th); | ||
595 | th = NULL; | ||
596 | } | ||
588 | if (NULL != handle) | 597 | if (NULL != handle) |
589 | { | 598 | { |
590 | GNUNET_TRANSPORT_disconnect(handle); | 599 | GNUNET_TRANSPORT_disconnect(handle); |