diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-02-24 11:19:09 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-02-24 11:19:09 +0000 |
commit | da4c63c9b34896642d9487b0b5a4ee2b1da76dae (patch) | |
tree | 04457e29b43cb91a11792057bd552de393dfa4f2 /src/dht | |
parent | fae8cff7a52abe62eca5d6db8a8aa4d9a95da244 (diff) | |
download | gnunet-da4c63c9b34896642d9487b0b5a4ee2b1da76dae.tar.gz gnunet-da4c63c9b34896642d9487b0b5a4ee2b1da76dae.zip |
possible fix for mantis bug 1663
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/dht_api.c | 6 |
1 files changed, 4 insertions, 2 deletions
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, | |||
287 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 287 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
288 | { | 288 | { |
289 | struct GNUNET_DHT_Handle *handle = cls; | 289 | struct GNUNET_DHT_Handle *handle = cls; |
290 | 290 | handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; | |
291 | if (handle->retry_time.rel_value < GNUNET_CONSTANTS_SERVICE_RETRY.rel_value) | 291 | if (handle->retry_time.rel_value < GNUNET_CONSTANTS_SERVICE_RETRY.rel_value) |
292 | handle->retry_time = GNUNET_CONSTANTS_SERVICE_RETRY; | 292 | handle->retry_time = GNUNET_CONSTANTS_SERVICE_RETRY; |
293 | else | 293 | else |
@@ -328,7 +328,7 @@ do_disconnect (struct GNUNET_DHT_Handle *handle) | |||
328 | { | 328 | { |
329 | if (handle->client == NULL) | 329 | if (handle->client == NULL) |
330 | return; | 330 | return; |
331 | 331 | GNUNET_assert(handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK); | |
332 | GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO); | 332 | GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO); |
333 | handle->client = NULL; | 333 | handle->client = NULL; |
334 | handle->reconnect_task = GNUNET_SCHEDULER_add_delayed (handle->retry_time, | 334 | handle->reconnect_task = GNUNET_SCHEDULER_add_delayed (handle->retry_time, |
@@ -607,6 +607,8 @@ GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle) | |||
607 | GNUNET_CLIENT_disconnect (handle->client, GNUNET_YES); | 607 | GNUNET_CLIENT_disconnect (handle->client, GNUNET_YES); |
608 | handle->client = NULL; | 608 | handle->client = NULL; |
609 | } | 609 | } |
610 | if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK) | ||
611 | GNUNET_SCHEDULER_cancel(handle->reconnect_task); | ||
610 | GNUNET_CONTAINER_multihashmap_destroy(handle->active_requests); | 612 | GNUNET_CONTAINER_multihashmap_destroy(handle->active_requests); |
611 | GNUNET_free (handle); | 613 | GNUNET_free (handle); |
612 | } | 614 | } |