aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-22 17:14:25 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-22 17:14:25 +0000
commitef32bc72416e56a918919abb1e147c3b7cad04f8 (patch)
tree7e430db675aa3aa30c7b1a360f93433b5db371d4 /src/transport/gnunet-service-transport_neighbours.c
parent257a91106e0630736cbb93d5d027f58414105b36 (diff)
downloadgnunet-ef32bc72416e56a918919abb1e147c3b7cad04f8.tar.gz
gnunet-ef32bc72416e56a918919abb1e147c3b7cad04f8.zip
-LRN: Mark session as completely disconnected later.
free_neighbour() calls plugin's disconnect() routine, which will invoke environment session free callback, which will do NOTHING if session is in "completely disconnected" state (in just "disconnected" state it will free primary address). Destroy address in free_address() to make ATS forget the session. Fixes #2446
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 02f4e43d1..918299fef 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -768,6 +768,14 @@ free_address (struct NeighbourAddress *na)
768 GNUNET_ATS_address_in_use (GST_ats, na->address, na->session, GNUNET_NO); 768 GNUNET_ATS_address_in_use (GST_ats, na->address, na->session, GNUNET_NO);
769 GNUNET_ATS_address_destroyed (GST_ats, na->address, na->session); 769 GNUNET_ATS_address_destroyed (GST_ats, na->address, na->session);
770 } 770 }
771 else
772 {
773 if (NULL != na->address)
774 {
775 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "HACK: destroy address\n");
776 GNUNET_ATS_address_destroyed (GST_ats, na->address, na->session);
777 }
778 }
771 na->ats_active = GNUNET_NO; 779 na->ats_active = GNUNET_NO;
772 if (NULL != na->address) 780 if (NULL != na->address)
773 { 781 {
@@ -2497,8 +2505,8 @@ master_task (void *cls,
2497 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2505 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2498 "Cleaning up connection to `%s' after sending DISCONNECT\n", 2506 "Cleaning up connection to `%s' after sending DISCONNECT\n",
2499 GNUNET_i2s (&n->id)); 2507 GNUNET_i2s (&n->id));
2500 n->state = S_DISCONNECT_FINISHED;
2501 free_neighbour (n, GNUNET_NO); 2508 free_neighbour (n, GNUNET_NO);
2509 n->state = S_DISCONNECT_FINISHED;
2502 return; 2510 return;
2503 case S_DISCONNECT_FINISHED: 2511 case S_DISCONNECT_FINISHED:
2504 /* how did we get here!? */ 2512 /* how did we get here!? */