GNUNET_assert (NULL == neighbor->connections);
neighbor->connections = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_NO);
- GNUNET_assert (NULL != neighbor->connections);
-
GNUNET_STATISTICS_update (stats,
"# peers",
1,
"DISCONNECTED %s <= %s\n",
own_id, GNUNET_i2s (peer));
direct_path = pop_direct_path (p);
- GNUNET_CONTAINER_multihashmap_iterate (p->connections,
- ¬ify_broken,
- p);
- GNUNET_CONTAINER_multihashmap_destroy (p->connections);
- p->connections = NULL;
+ if (NULL != p->connections)
+ {
+ GNUNET_CONTAINER_multihashmap_iterate (p->connections,
+ ¬ify_broken,
+ p);
+ GNUNET_CONTAINER_multihashmap_destroy (p->connections);
+ p->connections = NULL;
+ }
if (NULL != p->core_transmit)
{
GNUNET_CORE_notify_transmit_ready_cancel (p->core_transmit);
{
GNUNET_assert (0 == GNUNET_CONTAINER_multihashmap_size (peer->connections));
GNUNET_CONTAINER_multihashmap_destroy (peer->connections);
+ peer->connections = NULL;
}
- if (NULL != peer->core_transmit)
- GNUNET_CORE_notify_transmit_ready_cancel (peer->core_transmit);
if (NULL != peer->hello_offer)
{
GNUNET_TRANSPORT_offer_hello_cancel (peer->hello_offer);
{
GCP_queue_destroy (peer->queue_head, GNUNET_YES, GNUNET_NO, 0);
}
+ if (NULL != peer->core_transmit)
+ {
+ GNUNET_break (0); /* GCP_queue_destroy should've cancelled it! */
+ GNUNET_CORE_notify_transmit_ready_cancel (peer->core_transmit);
+ peer->core_transmit = NULL;
+ }
+
GNUNET_free_non_null (peer->hello);
GNUNET_free (peer);
return GNUNET_OK;
{
struct CadetPeer *p = value;
struct CadetTunnel *t = p->tunnel;
+
LOG (GNUNET_ERROR_TYPE_DEBUG, " shutting down %s\n", GCP_2s (p));
if (NULL != t)
GCT_destroy (t);