From 564e4a46044821e3881777bd7d373c8c209ef890 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 18 Jan 2015 13:22:12 +0000 Subject: [PATCH] removing dead logic to copy and pass around unused ATS values --- src/transport/gnunet-service-transport.c | 1 - .../gnunet-service-transport_neighbours.c | 25 ------------------- .../gnunet-service-transport_neighbours.h | 4 --- 3 files changed, 30 deletions(-) diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index b1cf9837b..4e96b0091 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -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); } diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 52d131e4e..748d88f1f 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -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); } diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h index eb33ce2ce..49a54e9dd 100644 --- a/src/transport/gnunet-service-transport_neighbours.h +++ b/src/transport/gnunet-service-transport_neighbours.h @@ -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); -- 2.25.1