aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-07-04 13:48:08 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-07-04 13:48:08 +0000
commit486c324303166781a887151af8bdc4183841567c (patch)
tree19bb21c859e75417e4929be880743b384568ea3f /src/transport
parent8f91c23b90d9a4e65bdacb0a9968376837769f5f (diff)
downloadgnunet-486c324303166781a887151af8bdc4183841567c.tar.gz
gnunet-486c324303166781a887151af8bdc4183841567c.zip
fixed: do not disconnect from neighbour if an address validations fails but other validations are still pending
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport.c15
1 files changed, 15 insertions, 0 deletions
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,
2708 "Session was never marked as ready for peer `%4s'\n", 2708 "Session was never marked as ready for peer `%4s'\n",
2709 GNUNET_i2s(peer)); 2709 GNUNET_i2s(peer));
2710#endif 2710#endif
2711
2712 int validations_pending = GNUNET_CONTAINER_multihashmap_contains (validation_map, &peer->hashPubKey);
2713
2714 /* No session was marked as ready, but we have pending validations so do not disconnect from neighbour */
2715 if (validations_pending ==GNUNET_YES)
2716 {
2717#if DEBUG_TRANSPORT
2718 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2719 "Not disconnecting from peer `%4s due to pending address validations\n", GNUNET_i2s(peer));
2720#endif
2721 return;
2722 }
2723
2711 //FIXME: This conflicts with inbound tcp connections and tcp nat ... debugging in progress 2724 //FIXME: This conflicts with inbound tcp connections and tcp nat ... debugging in progress
2712 GNUNET_STATISTICS_update (stats, 2725 GNUNET_STATISTICS_update (stats,
2713 gettext_noop ("# disconnects due to unready session"), 2726 gettext_noop ("# disconnects due to unready session"),
2714 1, 2727 1,
2715 GNUNET_NO); 2728 GNUNET_NO);
2729
2716 disconnect_neighbour (nl, GNUNET_YES); 2730 disconnect_neighbour (nl, GNUNET_YES);
2717 return; /* was never marked as connected */ 2731 return; /* was never marked as connected */
2718 } 2732 }
@@ -5110,6 +5124,7 @@ disconnect_neighbour (struct NeighbourList *n, int check)
5110 "Disconnecting from `%4s'\n", 5124 "Disconnecting from `%4s'\n",
5111 GNUNET_i2s (&n->id)); 5125 GNUNET_i2s (&n->id));
5112#endif 5126#endif
5127
5113 /* remove n from neighbours list */ 5128 /* remove n from neighbours list */
5114 nprev = NULL; 5129 nprev = NULL;
5115 npos = neighbours; 5130 npos = neighbours;