[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r15457 - gnunet/src/core
From: |
gnunet |
Subject: |
[GNUnet-SVN] r15457 - gnunet/src/core |
Date: |
Tue, 7 Jun 2011 23:48:28 +0200 |
Author: grothoff
Date: 2011-06-07 23:48:28 +0200 (Tue, 07 Jun 2011)
New Revision: 15457
Modified:
gnunet/src/core/core_api.c
Log:
fix assertion failure on shutdown
Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c 2011-06-07 18:09:57 UTC (rev 15456)
+++ gnunet/src/core/core_api.c 2011-06-07 21:48:28 UTC (rev 15457)
@@ -417,19 +417,6 @@
GNUNET_CORE_PeerConfigurationInfoCallback pcic;
void *pcic_cls;
- while (NULL != (th = pr->pending_head))
- {
- GNUNET_CONTAINER_DLL_remove (pr->pending_head,
- pr->pending_tail,
- th);
- pr->queue_size--;
- GNUNET_assert (0 ==
- th->get_message (th->get_message_cls,
- 0, NULL));
- if (th->cm != NULL)
- th->cm->th = NULL;
- GNUNET_free (th);
- }
if (NULL != (pcic = pr->pcic))
{
pcic_cls = pr->pcic_cls;
@@ -451,7 +438,6 @@
GNUNET_SCHEDULER_cancel (pr->ntr_task);
pr->ntr_task = GNUNET_SCHEDULER_NO_TASK;
}
- GNUNET_assert (pr->queue_size == 0);
if ( (pr->prev != NULL) ||
(pr->next != NULL) ||
(h->ready_peer_head == pr) )
@@ -460,7 +446,20 @@
pr);
if (h->disconnects != NULL)
h->disconnects (h->cls,
- &pr->peer);
+ &pr->peer);
+ /* all requests should have been cancelled, clean up anyway, just in case */
+ GNUNET_break (pr->queue_size == 0);
+ while (NULL != (th = pr->pending_head))
+ {
+ GNUNET_break (0);
+ GNUNET_CONTAINER_DLL_remove (pr->pending_head,
+ pr->pending_tail,
+ th);
+ pr->queue_size--;
+ if (th->cm != NULL)
+ th->cm->th = NULL;
+ GNUNET_free (th);
+ }
GNUNET_assert (GNUNET_YES ==
GNUNET_CONTAINER_multihashmap_remove (h->peers,
key,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r15457 - gnunet/src/core,
gnunet <=