From e39c250461bdbc5e251d63cb7e3c310c1b7df2b5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 9 Nov 2011 14:28:05 +0000 Subject: cleanup --- src/transport/plugin_transport_udp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 00e0a9fa3..51e856804 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c @@ -341,7 +341,6 @@ struct Plugin */ int broadcast; - /** * Tokenizer for inbound messages. */ @@ -515,6 +514,9 @@ destroy_session (void *cls, const GNUNET_HashCode * key, void *value) { struct Session *peer_session = value; + GNUNET_assert (GNUNET_YES == + GNUNET_CONTAINER_multihashmap_remove (peer_session->plugin->sessions, + &peer_session->target.hashPubKey, peer_session)); if (peer_session->frag != NULL) GNUNET_FRAGMENT_context_destroy (peer_session->frag); if (GNUNET_SCHEDULER_NO_TASK != peer_session->delayed_cont_task) @@ -523,6 +525,7 @@ destroy_session (void *cls, const GNUNET_HashCode * key, void *value) return GNUNET_OK; } + /** * Destroy a session, plugin is being unloaded. * @@ -540,11 +543,12 @@ destroy_inbound_session (void *cls, const GNUNET_HashCode * key, void *value) GNUNET_SCHEDULER_cancel (s->invalidation_task); if (GNUNET_SCHEDULER_NO_TASK != s->delayed_cont_task) GNUNET_SCHEDULER_cancel (s->delayed_cont_task); - GNUNET_CONTAINER_multihashmap_remove(s->plugin->inbound_sessions, &s->target.hashPubKey, s); + GNUNET_CONTAINER_multihashmap_remove (s->plugin->inbound_sessions, &s->target.hashPubKey, s); GNUNET_free (s); return GNUNET_OK; } + /** * Disconnect from a remote node. Clean up session if we have one for this peer * @@ -569,9 +573,6 @@ udp_disconnect (void *cls, const struct GNUNET_PeerIdentity *target) GNUNET_CONTAINER_multihashmap_get_multiple (plugin->inbound_sessions, &target->hashPubKey, &destroy_inbound_session, NULL); - GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sendto"); - - plugin->last_expected_delay = GNUNET_FRAGMENT_context_destroy (session->frag); if (GNUNET_SCHEDULER_NO_TASK != session->delayed_cont_task) GNUNET_SCHEDULER_cancel (session->delayed_cont_task); -- cgit v1.2.3