diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-06-07 21:48:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-06-07 21:48:28 +0000 |
commit | ed3a7ec416953081af45ed3afee56087a61b023d (patch) | |
tree | a948c1c16a29f5380bf53c836a0726a08cf31379 /src/core/core_api.c | |
parent | 37182cbe5accb462176f578d03b71098c467e08e (diff) | |
download | gnunet-ed3a7ec416953081af45ed3afee56087a61b023d.tar.gz gnunet-ed3a7ec416953081af45ed3afee56087a61b023d.zip |
fix assertion failure on shutdown
Diffstat (limited to 'src/core/core_api.c')
-rw-r--r-- | src/core/core_api.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index 55b693cd1..5b90a11ed 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -417,19 +417,6 @@ disconnect_and_free_peer_entry (void *cls, | |||
417 | GNUNET_CORE_PeerConfigurationInfoCallback pcic; | 417 | GNUNET_CORE_PeerConfigurationInfoCallback pcic; |
418 | void *pcic_cls; | 418 | void *pcic_cls; |
419 | 419 | ||
420 | while (NULL != (th = pr->pending_head)) | ||
421 | { | ||
422 | GNUNET_CONTAINER_DLL_remove (pr->pending_head, | ||
423 | pr->pending_tail, | ||
424 | th); | ||
425 | pr->queue_size--; | ||
426 | GNUNET_assert (0 == | ||
427 | th->get_message (th->get_message_cls, | ||
428 | 0, NULL)); | ||
429 | if (th->cm != NULL) | ||
430 | th->cm->th = NULL; | ||
431 | GNUNET_free (th); | ||
432 | } | ||
433 | if (NULL != (pcic = pr->pcic)) | 420 | if (NULL != (pcic = pr->pcic)) |
434 | { | 421 | { |
435 | pcic_cls = pr->pcic_cls; | 422 | pcic_cls = pr->pcic_cls; |
@@ -451,7 +438,6 @@ disconnect_and_free_peer_entry (void *cls, | |||
451 | GNUNET_SCHEDULER_cancel (pr->ntr_task); | 438 | GNUNET_SCHEDULER_cancel (pr->ntr_task); |
452 | pr->ntr_task = GNUNET_SCHEDULER_NO_TASK; | 439 | pr->ntr_task = GNUNET_SCHEDULER_NO_TASK; |
453 | } | 440 | } |
454 | GNUNET_assert (pr->queue_size == 0); | ||
455 | if ( (pr->prev != NULL) || | 441 | if ( (pr->prev != NULL) || |
456 | (pr->next != NULL) || | 442 | (pr->next != NULL) || |
457 | (h->ready_peer_head == pr) ) | 443 | (h->ready_peer_head == pr) ) |
@@ -460,7 +446,20 @@ disconnect_and_free_peer_entry (void *cls, | |||
460 | pr); | 446 | pr); |
461 | if (h->disconnects != NULL) | 447 | if (h->disconnects != NULL) |
462 | h->disconnects (h->cls, | 448 | h->disconnects (h->cls, |
463 | &pr->peer); | 449 | &pr->peer); |
450 | /* all requests should have been cancelled, clean up anyway, just in case */ | ||
451 | GNUNET_break (pr->queue_size == 0); | ||
452 | while (NULL != (th = pr->pending_head)) | ||
453 | { | ||
454 | GNUNET_break (0); | ||
455 | GNUNET_CONTAINER_DLL_remove (pr->pending_head, | ||
456 | pr->pending_tail, | ||
457 | th); | ||
458 | pr->queue_size--; | ||
459 | if (th->cm != NULL) | ||
460 | th->cm->th = NULL; | ||
461 | GNUNET_free (th); | ||
462 | } | ||
464 | GNUNET_assert (GNUNET_YES == | 463 | GNUNET_assert (GNUNET_YES == |
465 | GNUNET_CONTAINER_multihashmap_remove (h->peers, | 464 | GNUNET_CONTAINER_multihashmap_remove (h->peers, |
466 | key, | 465 | key, |