From: Christian Grothoff Date: Wed, 17 Feb 2010 14:39:10 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~22687 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ac186e5c747ebefa967c64a7ee722afb59652943;p=oweals%2Fgnunet.git fix --- 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); }