From: Nathan S. Evans Date: Thu, 24 Feb 2011 11:19:09 +0000 (+0000) Subject: possible fix for mantis bug 1663 X-Git-Tag: initial-import-from-subversion-38251~19062 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=da4c63c9b34896642d9487b0b5a4ee2b1da76dae;p=oweals%2Fgnunet.git possible fix for mantis bug 1663 --- diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index ae191660a..820bf35c8 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -287,7 +287,7 @@ try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct GNUNET_DHT_Handle *handle = cls; - + handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; if (handle->retry_time.rel_value < GNUNET_CONSTANTS_SERVICE_RETRY.rel_value) handle->retry_time = GNUNET_CONSTANTS_SERVICE_RETRY; else @@ -328,7 +328,7 @@ do_disconnect (struct GNUNET_DHT_Handle *handle) { if (handle->client == NULL) return; - + GNUNET_assert(handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK); GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO); handle->client = NULL; handle->reconnect_task = GNUNET_SCHEDULER_add_delayed (handle->retry_time, @@ -607,6 +607,8 @@ GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle) GNUNET_CLIENT_disconnect (handle->client, GNUNET_YES); handle->client = NULL; } + if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK) + GNUNET_SCHEDULER_cancel(handle->reconnect_task); GNUNET_CONTAINER_multihashmap_destroy(handle->active_requests); GNUNET_free (handle); }