From 3243958ee319d4b444a5aa3fb3950f4bcaeb62e6 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Mon, 18 Jun 2012 13:00:11 +0000 Subject: [PATCH] - fix --- src/transport/gnunet-service-transport.c | 2 +- .../gnunet-service-transport_neighbours.c | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index b2b59c8e2..1166b34ee 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -357,7 +357,7 @@ plugin_env_session_end (void *cls, const struct GNUNET_PeerIdentity *peer, if (GNUNET_NO == ret) { /* This was a session currently not used by - * neighbours so we have to destroy it here */ + * neighbours so we have to try to destroy it here */ GNUNET_ATS_address_destroyed (GST_ats, &address, session); } } diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 78e160fa0..c6281f1ba 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -2154,9 +2154,11 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, return; } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "ATS tells us to switch to address '%s' for peer `%s'\n", + "ATS tells us to switch to address '%s' session %p for peer `%s'\n", (address->address_length != 0) ? GST_plugins_a2s (address): "", + session, GNUNET_i2s (peer)); + switch (n->state) { case S_NOT_CONNECTED: @@ -2602,10 +2604,10 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, GNUNET_NO); connect_notify_cb (callback_cls, &n->id, ats, ats_count); /* Tell ATS that the outbound session we created to send CONNECT was successfull */ - GNUNET_ATS_address_add(GST_ats, - n->primary_address.address, - n->primary_address.session, - ats, ats_count); + GNUNET_ATS_address_add (GST_ats, + n->primary_address.address, + n->primary_address.session, + ats, ats_count); set_address (&n->primary_address, n->primary_address.address, n->primary_address.session, @@ -2650,6 +2652,10 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, n->state = S_CONNECTED; n->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); GNUNET_break (GNUNET_NO == n->alternative_address.ats_active); + GNUNET_ATS_address_add(GST_ats, + n->alternative_address.address, + n->alternative_address.session, + ats, ats_count); set_address (&n->primary_address, n->alternative_address.address, n->alternative_address.session, @@ -2856,6 +2862,10 @@ GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message, ++neighbours_connected, GNUNET_NO); connect_notify_cb (callback_cls, &n->id, ats, ats_count); + GNUNET_ATS_address_add(GST_ats, + n->primary_address.address, + n->primary_address.session, + ats, ats_count); set_address (&n->primary_address, n->primary_address.address, n->primary_address.session, -- 2.25.1