aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-05-15 08:09:16 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-05-15 08:09:16 +0000
commitca8ca1d787d579f8fc0771c7e0fec559c8d70735 (patch)
tree29a8a85fd8abc6296f059b3f6aec7253bde3ebe8
parent88d6288cbb71f6b15befe41cde955cf2448c514e (diff)
downloadgnunet-ca8ca1d787d579f8fc0771c7e0fec559c8d70735.tar.gz
gnunet-ca8ca1d787d579f8fc0771c7e0fec559c8d70735.zip
fix for mantis 2355
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 821d66b54..2ee73fec7 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -795,9 +795,6 @@ free_neighbour (struct NeighbourMapEntry *n)
795 struct MessageQueue *mq; 795 struct MessageQueue *mq;
796 struct GNUNET_TRANSPORT_PluginFunctions *papi; 796 struct GNUNET_TRANSPORT_PluginFunctions *papi;
797 797
798 GNUNET_assert (GNUNET_YES ==
799 GNUNET_CONTAINER_multihashmap_remove (neighbours,
800 &n->id.hashPubKey, n));
801 n->is_active = NULL; /* always free'd by its own continuation! */ 798 n->is_active = NULL; /* always free'd by its own continuation! */
802 799
803 /* fail messages currently in the queue */ 800 /* fail messages currently in the queue */
@@ -818,7 +815,6 @@ free_neighbour (struct NeighbourMapEntry *n)
818 GNUNET_NO); 815 GNUNET_NO);
819 disconnect_notify_cb (callback_cls, &n->id); 816 disconnect_notify_cb (callback_cls, &n->id);
820 } 817 }
821 n->state = S_DISCONNECT_FINISHED;
822 818
823 /* FIXME-PLUGIN-API: This does not seem to guarantee that all 819 /* FIXME-PLUGIN-API: This does not seem to guarantee that all
824 transport sessions eventually get killed due to inactivity; they 820 transport sessions eventually get killed due to inactivity; they
@@ -833,6 +829,12 @@ free_neighbour (struct NeighbourMapEntry *n)
833 (NULL != (papi = GST_plugins_find (n->primary_address.address->transport_name))) ) 829 (NULL != (papi = GST_plugins_find (n->primary_address.address->transport_name))) )
834 papi->disconnect (papi->cls, &n->id); 830 papi->disconnect (papi->cls, &n->id);
835 831
832 n->state = S_DISCONNECT_FINISHED;
833
834 GNUNET_assert (GNUNET_YES ==
835 GNUNET_CONTAINER_multihashmap_remove (neighbours,
836 &n->id.hashPubKey, n));
837
836 /* cut transport-level connection */ 838 /* cut transport-level connection */
837 free_address (&n->primary_address); 839 free_address (&n->primary_address);
838 free_address (&n->alternative_address); 840 free_address (&n->alternative_address);
@@ -1054,6 +1056,12 @@ transmit_send_continuation (void *cls,
1054 struct NeighbourMapEntry *n; 1056 struct NeighbourMapEntry *n;
1055 1057
1056 n = lookup_neighbour (receiver); 1058 n = lookup_neighbour (receiver);
1059 if (NULL == n)
1060 {
1061 GNUNET_break (0);
1062 return;
1063 }
1064
1057 if (n->is_active == mq) 1065 if (n->is_active == mq)
1058 { 1066 {
1059 /* this is still "our" neighbour, remove us from its queue 1067 /* this is still "our" neighbour, remove us from its queue