From ac186e5c747ebefa967c64a7ee722afb59652943 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 17 Feb 2010 14:39:10 +0000 Subject: [PATCH] fix --- src/core/gnunet-service-core.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index b07d565f1..f44346011 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c @@ -1025,7 +1025,10 @@ free_neighbour (struct Neighbour *n) GNUNET_free (m); } if (NULL != n->th) - GNUNET_TRANSPORT_notify_transmit_ready_cancel (n->th); + { + GNUNET_TRANSPORT_notify_transmit_ready_cancel (n->th); + n->th = NULL; + } if (n->retry_plaintext_task != GNUNET_SCHEDULER_NO_TASK) GNUNET_SCHEDULER_cancel (sched, n->retry_plaintext_task); if (n->retry_set_key_task != GNUNET_SCHEDULER_NO_TASK) @@ -2029,6 +2032,24 @@ handle_client_send (void *cls, } +/** + * Function called when the transport service is ready to + * receive a message. Only resets 'n->th' to NULL. + * + * @param cls neighbour to use message from + * @param size number of bytes we can transmit + * @param buf where to copy the message + * @return number of bytes transmitted + */ +static size_t +notify_transport_connect_done (void *cls, size_t size, void *buf) +{ + struct Neighbour *n = cls; + n->th = NULL; + return 0; +} + + /** * Handle CORE_REQUEST_CONNECT request. * @@ -2063,8 +2084,9 @@ handle_client_request_connect (void *cls, &cm->peer, 0, 0, GNUNET_TIME_UNIT_ZERO, - NULL, - NULL); + ¬ify_transport_connect_done, + n); + GNUNET_break (NULL != n->th); } -- 2.25.1