- fix
authorMatthias Wachs <wachs@net.in.tum.de>
Mon, 18 Jun 2012 13:00:11 +0000 (13:00 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Mon, 18 Jun 2012 13:00:11 +0000 (13:00 +0000)
src/transport/gnunet-service-transport.c
src/transport/gnunet-service-transport_neighbours.c

index b2b59c8e2c585fc04dd5246f3d4d25ff25211f6a..1166b34ee696f909a7591163a4ec81a6c091df9c 100644 (file)
@@ -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);
   }
 }
index 78e160fa0eb19734aadf5fb1eef7e3ecd2a52240..c6281f1bae77a292aa906de97f679bbd81b7e3ad 100644 (file)
@@ -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): "<inbound>",
+              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,