diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-06-01 15:37:23 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-06-01 15:37:23 +0000 |
commit | d97ae17cbba307f8261c7b223daa0fec2b57d464 (patch) | |
tree | 0988093be80905a94ec3c689c75569ac732a9a95 /src/core/core_api.c | |
parent | 7cfb022e404453a208d80e0a911c976cd49b561d (diff) | |
download | gnunet-d97ae17cbba307f8261c7b223daa0fec2b57d464.tar.gz gnunet-d97ae17cbba307f8261c7b223daa0fec2b57d464.zip |
fix
Diffstat (limited to 'src/core/core_api.c')
-rw-r--r-- | src/core/core_api.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index d0dc892cd..52f5d9258 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -488,6 +488,17 @@ reconnect_later (struct GNUNET_CORE_Handle *h) | |||
488 | struct PeerRecord *pr; | 488 | struct PeerRecord *pr; |
489 | 489 | ||
490 | GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); | 490 | GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); |
491 | if (h->client != NULL) | ||
492 | { | ||
493 | GNUNET_CLIENT_disconnect (h->client, GNUNET_NO); | ||
494 | h->client = NULL; | ||
495 | h->cth = NULL; | ||
496 | } | ||
497 | h->currently_down = GNUNET_YES; | ||
498 | GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); | ||
499 | h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->retry_backoff, | ||
500 | &reconnect_task, | ||
501 | h); | ||
491 | while (NULL != (cm = h->control_pending_head)) | 502 | while (NULL != (cm = h->control_pending_head)) |
492 | { | 503 | { |
493 | GNUNET_CONTAINER_DLL_remove (h->control_pending_head, | 504 | GNUNET_CONTAINER_DLL_remove (h->control_pending_head, |
@@ -499,24 +510,13 @@ reconnect_later (struct GNUNET_CORE_Handle *h) | |||
499 | cm->cont (cm->cont_cls, GNUNET_NO); | 510 | cm->cont (cm->cont_cls, GNUNET_NO); |
500 | GNUNET_free (cm); | 511 | GNUNET_free (cm); |
501 | } | 512 | } |
502 | if (h->client != NULL) | 513 | GNUNET_CONTAINER_multihashmap_iterate (h->peers, |
503 | { | 514 | &disconnect_and_free_peer_entry, |
504 | GNUNET_CLIENT_disconnect (h->client, GNUNET_NO); | 515 | h); |
505 | h->client = NULL; | ||
506 | h->cth = NULL; | ||
507 | GNUNET_CONTAINER_multihashmap_iterate (h->peers, | ||
508 | &disconnect_and_free_peer_entry, | ||
509 | h); | ||
510 | } | ||
511 | while (NULL != (pr = h->ready_peer_head)) | 516 | while (NULL != (pr = h->ready_peer_head)) |
512 | GNUNET_CONTAINER_DLL_remove (h->ready_peer_head, | 517 | GNUNET_CONTAINER_DLL_remove (h->ready_peer_head, |
513 | h->ready_peer_tail, | 518 | h->ready_peer_tail, |
514 | pr); | 519 | pr); |
515 | h->currently_down = GNUNET_YES; | ||
516 | GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); | ||
517 | h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->retry_backoff, | ||
518 | &reconnect_task, | ||
519 | h); | ||
520 | GNUNET_assert (h->control_pending_head == NULL); | 520 | GNUNET_assert (h->control_pending_head == NULL); |
521 | h->retry_backoff = GNUNET_TIME_relative_min (GNUNET_TIME_UNIT_SECONDS, | 521 | h->retry_backoff = GNUNET_TIME_relative_min (GNUNET_TIME_UNIT_SECONDS, |
522 | h->retry_backoff); | 522 | h->retry_backoff); |