- change for mantis 0002445
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 29 Jun 2012 15:16:37 +0000 (15:16 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 29 Jun 2012 15:16:37 +0000 (15:16 +0000)
src/transport/gnunet-service-transport.c
src/transport/gnunet-service-transport_neighbours.c

index a0ce0980e2931f7a419fc684b571fa38c40ce550..6bba8a12ddf3811603b43cd9c0a4674b22bdddbb 100644 (file)
@@ -340,7 +340,6 @@ plugin_env_session_end (void *cls, const struct GNUNET_PeerIdentity *peer,
 {
   const char *transport_name = cls;
   struct GNUNET_HELLO_Address address;
-  int ret;
 
   GNUNET_assert (strlen (transport_name) > 0);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Session %p to peer `%s' ended \n",
@@ -354,13 +353,10 @@ plugin_env_session_end (void *cls, const struct GNUNET_PeerIdentity *peer,
   address.address = NULL;
   address.address_length = 0;
   address.transport_name = transport_name;
-  ret = GST_neighbours_session_terminated (peer, session);
-  if (GNUNET_NO == ret)
-  {
-    /* This was a session currently not used by
-     * neighbours so we have to try to destroy it here */
-    GNUNET_ATS_address_destroyed (GST_ats, &address, session);
-  }
+  GST_neighbours_session_terminated (peer, session);
+
+  /* Tell ATS that session has ended */
+  GNUNET_ATS_address_destroyed (GST_ats, &address, session);
 }
 
 
index 39848f8a3ac3208d1e3d008e7055c53323d756a5..71245d4938e231f9f41b5de903eb527e9d5fa00b 100644 (file)
@@ -772,16 +772,8 @@ free_address (struct NeighbourAddress *na)
   {
     GST_validation_set_address_use (na->address, na->session, GNUNET_NO, __LINE__);
     GNUNET_ATS_address_in_use (GST_ats, na->address, na->session, GNUNET_NO);
-    GNUNET_ATS_address_destroyed (GST_ats, na->address, na->session);
-  }
-  else
-  {
-    if (NULL != na->address)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "HACK: destroy address\n");
-      GNUNET_ATS_address_destroyed (GST_ats, na->address, na->session);
-    }
   }
+
   na->ats_active = GNUNET_NO;
   if (NULL != na->address)
   {
@@ -2827,6 +2819,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
     break;
   case S_DISCONNECT_FINISHED:
     /* neighbour was freed and plugins told to terminate session */
+    return GNUNET_NO;
     break;
   default:
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unhandled state `%s' \n",print_state (n->state));