From: Christian Grothoff Date: Mon, 28 May 2012 13:00:56 +0000 (+0000) Subject: -fix kill logic (#2381), interpretation of flag was inverted X-Git-Tag: initial-import-from-subversion-38251~13376 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7ba9eb10f99594e5a4bf5a27c4c4747fbd8cc88c;p=oweals%2Fgnunet.git -fix kill logic (#2381), interpretation of flag was inverted --- diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 1c7cc9f59..59132bddc 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -847,10 +847,11 @@ set_address (struct NeighbourAddress *na, * Free a neighbour map entry. * * @param n entry to free - * @param terminate tell plugin to terminate sessions + * @param keep_sessions GNUNET_NO to tell plugin to terminate sessions, + * GNUNET_YES to keep all sessions */ static void -free_neighbour (struct NeighbourMapEntry *n, int terminate) +free_neighbour (struct NeighbourMapEntry *n, int keep_sessions) { struct MessageQueue *mq; struct GNUNET_TRANSPORT_PluginFunctions *papi; @@ -885,7 +886,7 @@ free_neighbour (struct NeighbourMapEntry *n, int terminate) API gives us not even the means to selectively kill only one of them! Killing all sessions like this seems to be very, very wrong. */ - if ((GNUNET_YES == terminate) && + if ((GNUNET_NO == keep_sessions) && (NULL != n->primary_address.address) && (NULL != (papi = GST_plugins_find (n->primary_address.address->transport_name)))) papi->disconnect (papi->cls, &n->id);