removing dead logic to copy and pass around unused ATS values
authorChristian Grothoff <christian@grothoff.org>
Sun, 18 Jan 2015 13:22:12 +0000 (13:22 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 18 Jan 2015 13:22:12 +0000 (13:22 +0000)
src/transport/gnunet-service-transport.c
src/transport/gnunet-service-transport_neighbours.c
src/transport/gnunet-service-transport_neighbours.h

index b1cf9837b46701e1bbdcf51b2d646fa46daae4ce..4e96b009121d8b9db9e5aef221a2096191b33f96 100644 (file)
@@ -928,7 +928,6 @@ ats_request_address_change (void *cls,
   GST_neighbours_switch_to_address (&address->peer,
                                     address,
                                     session,
-                                    ats, ats_count,
                                     bandwidth_in, bandwidth_out);
 }
 
index 52d131e4e3deafdaca7803a1446451e253414a31..748d88f1f63d4f50e8914bf0ab46ab6597a5e084 100644 (file)
@@ -2154,8 +2154,6 @@ struct BlacklistCheckSwitchContext
 
   struct GNUNET_HELLO_Address *address;
   struct Session *session;
-  struct GNUNET_ATS_Information *ats;
-  uint32_t ats_count;
 
   struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in;
   struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out;
@@ -2480,7 +2478,6 @@ switch_address_bl_check_cont (void *cls,
     /* Remove blacklist check and clean up */
     GNUNET_CONTAINER_DLL_remove (pending_bc_head, pending_bc_tail, blc_ctx);
     GNUNET_HELLO_address_free (blc_ctx->address);
-    GNUNET_free_non_null (blc_ctx->ats);
     GNUNET_free (blc_ctx);
     return;
   }
@@ -2504,7 +2501,6 @@ switch_address_bl_check_cont (void *cls,
 
     GNUNET_CONTAINER_DLL_remove (pending_bc_head, pending_bc_tail, blc_ctx);
     GNUNET_HELLO_address_free (blc_ctx->address);
-    GNUNET_free_non_null (blc_ctx->ats);
     GNUNET_free (blc_ctx);
     return;
   }
@@ -2526,9 +2522,7 @@ switch_address_bl_check_cont (void *cls,
 
       GNUNET_CONTAINER_DLL_remove (pending_bc_head, pending_bc_tail, blc_ctx);
       GNUNET_HELLO_address_free(blc_ctx->address);
-      GNUNET_free_non_null (blc_ctx->ats);
       GNUNET_free (blc_ctx);
-
       return;
     }
   }
@@ -2682,7 +2676,6 @@ switch_address_bl_check_cont (void *cls,
 
   GNUNET_CONTAINER_DLL_remove (pending_bc_head, pending_bc_tail, blc_ctx);
   GNUNET_HELLO_address_free (blc_ctx->address);
-  GNUNET_free_non_null (blc_ctx->ats);
   GNUNET_free (blc_ctx);
 }
 
@@ -2696,8 +2689,6 @@ switch_address_bl_check_cont (void *cls,
  * @param peer identity of the peer to switch the address for
  * @param address address of the other peer,
  * @param session session to use or NULL if transport should initiate a session
- * @param ats performance data
- * @param ats_count number of entries in ats
  * @param bandwidth_in inbound quota to be used when connection is up,
  *     0 to disconnect from peer
  * @param bandwidth_out outbound quota to be used when connection is up,
@@ -2707,15 +2698,12 @@ void
 GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
                                  const struct GNUNET_HELLO_Address *address,
                                  struct Session *session,
-                                 const struct GNUNET_ATS_Information *ats,
-                                 uint32_t ats_count,
                                  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
                                  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
 {
   struct NeighbourMapEntry *n;
   struct GST_BlacklistCheck *blc;
   struct BlacklistCheckSwitchContext *blc_ctx;
-  int c;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "ATS has decided on an address for peer %s\n",
@@ -2765,18 +2753,6 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
   blc_ctx->session = session;
   blc_ctx->bandwidth_in = bandwidth_in;
   blc_ctx->bandwidth_out = bandwidth_out;
-  blc_ctx->ats_count = ats_count;
-  blc_ctx->ats = NULL;
-  if (ats_count > 0)
-  {
-    blc_ctx->ats = GNUNET_malloc (ats_count * sizeof (struct GNUNET_ATS_Information));
-    for (c = 0; c < ats_count; c++)
-    {
-      blc_ctx->ats[c].type = ats[c].type;
-      blc_ctx->ats[c].value = ats[c].value;
-    }
-  }
-
   GNUNET_CONTAINER_DLL_insert (pending_bc_head,
                                pending_bc_tail,
                                blc_ctx);
@@ -3907,7 +3883,6 @@ GST_neighbours_stop ()
     }
     if (NULL != cur->address)
       GNUNET_HELLO_address_free (cur->address);
-    GNUNET_free_non_null (cur->ats);
     GNUNET_free (cur);
   }
 
index eb33ce2ce61bdab5c5d790d587ad8e6285e50fc7..49a54e9ddbb41b790a49d86d02b072f3c8544bf8 100644 (file)
@@ -255,8 +255,6 @@ GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer,
  * @param address address of the other peer, NULL if other peer
  *                       connected to us
  * @param session session to use (or NULL)
- * @param ats performance data
- * @param ats_count number of entries in ats
  * @param bandwidth_in inbound quota to be used when connection is up
  * @param bandwidth_out outbound quota to be used when connection is up
  */
@@ -264,8 +262,6 @@ void
 GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
                                   const struct GNUNET_HELLO_Address *address,
                                   struct Session *session,
-                                  const struct GNUNET_ATS_Information *ats,
-                                  uint32_t ats_count,
                                   struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
                                   struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out);