From: Matthias Wachs Date: Mon, 4 Jul 2011 13:48:08 +0000 (+0000) Subject: fixed: do not disconnect from neighbour if an address validations fails but other... X-Git-Tag: initial-import-from-subversion-38251~17966 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=486c324303166781a887151af8bdc4183841567c;p=oweals%2Fgnunet.git fixed: do not disconnect from neighbour if an address validations fails but other validations are still pending --- diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index db1075ad4..f12787a55 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -2708,11 +2708,25 @@ plugin_env_session_end (void *cls, "Session was never marked as ready for peer `%4s'\n", GNUNET_i2s(peer)); #endif + + int validations_pending = GNUNET_CONTAINER_multihashmap_contains (validation_map, &peer->hashPubKey); + + /* No session was marked as ready, but we have pending validations so do not disconnect from neighbour */ + if (validations_pending ==GNUNET_YES) + { +#if DEBUG_TRANSPORT + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Not disconnecting from peer `%4s due to pending address validations\n", GNUNET_i2s(peer)); +#endif + return; + } + //FIXME: This conflicts with inbound tcp connections and tcp nat ... debugging in progress GNUNET_STATISTICS_update (stats, gettext_noop ("# disconnects due to unready session"), 1, GNUNET_NO); + disconnect_neighbour (nl, GNUNET_YES); return; /* was never marked as connected */ } @@ -5110,6 +5124,7 @@ disconnect_neighbour (struct NeighbourList *n, int check) "Disconnecting from `%4s'\n", GNUNET_i2s (&n->id)); #endif + /* remove n from neighbours list */ nprev = NULL; npos = neighbours;