From: Christian Grothoff Date: Mon, 10 Oct 2011 08:38:39 +0000 (+0000) Subject: remove limit_outbound, DCE X-Git-Tag: initial-import-from-subversion-38251~16694 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ea3717b6ea09ac10b68f1b21de5ddc2d8da5e440;p=oweals%2Fgnunet.git remove limit_outbound, DCE --- diff --git a/src/core/core.h b/src/core/core.h index a1854ccb4..f57d2b597 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -255,11 +255,9 @@ struct RequestInfoMessage uint32_t rim_id GNUNET_PACKED; /** - * Limit the number of bytes of outbound traffic to this - * peer to at most the specified amount (naturally, the - * amount is also limited by the receiving peer). + * Reserved, always zero. */ - struct GNUNET_BANDWIDTH_Value32NBO limit_outbound; + uint32_t reserved GNUNET_PACKED; /** * Number of bytes of inbound traffic to reserve, can diff --git a/src/core/core_api.c b/src/core/core_api.c index 91368ffc3..c740f593c 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -1722,7 +1722,7 @@ GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, rim->header.size = htons (sizeof (struct RequestInfoMessage)); rim->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_REQUEST_INFO); rim->rim_id = htonl (pr->rim_id = h->rim_id_gen++); - rim->limit_outbound = GNUNET_BANDWIDTH_VALUE_MAX; // FIXME: remove entirely soon... + rim->reserved = htonl (0); rim->reserve_inbound = htonl (amount); rim->preference_change = GNUNET_htonll (preference); rim->peer = *peer; diff --git a/src/core/gnunet-service-core_neighbours.c b/src/core/gnunet-service-core_neighbours.c index c3456ccf4..774c173dc 100644 --- a/src/core/gnunet-service-core_neighbours.c +++ b/src/core/gnunet-service-core_neighbours.c @@ -113,11 +113,6 @@ struct Neighbour */ GNUNET_SCHEDULER_TaskIdentifier retry_plaintext_task; - /** - * Tracking bandwidth for sending to this peer. - */ - struct GNUNET_BANDWIDTH_Tracker available_send_window; - /** * Tracking bandwidth for sending to this peer. */ @@ -251,7 +246,6 @@ transmit_ready (void *cls, size_t size, void *buf) GNUNET_assert (size >= m->size); memcpy (cbuf, &m[1], m->size); ret = m->size; - GNUNET_BANDWIDTH_tracker_consume (&n->available_send_window, m->size); #if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Copied message of type %u and size %u into transport buffer for `%4s'\n", @@ -351,9 +345,6 @@ handle_transport_notify_connect (void *cls, #endif n = GNUNET_malloc (sizeof (struct Neighbour)); n->peer = *peer; - GNUNET_BANDWIDTH_tracker_init (&n->available_send_window, - GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT, - MAX_WINDOW_TIME_S); GNUNET_BANDWIDTH_tracker_init (&n->available_recv_window, GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT, MAX_WINDOW_TIME_S); diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c index 93f9b6950..6ab97d7d0 100644 --- a/src/core/gnunet-service-core_sessions.c +++ b/src/core/gnunet-service-core_sessions.c @@ -121,12 +121,6 @@ struct Session */ GNUNET_SCHEDULER_TaskIdentifier cork_task; - /** - * Tracking bandwidth for sending to this peer. - * // FIXME: unused! should it be used? - */ - struct GNUNET_BANDWIDTH_Tracker available_send_window; - /** * Tracking bandwidth for receiving from this peer. * // FIXME: need to set it! @@ -134,15 +128,19 @@ struct Session struct GNUNET_BANDWIDTH_Tracker available_recv_window; /** - * Available bandwidth out for this peer (current target). - * // FIXME: check usage! + * Available bandwidth out for this peer (current target). This + * value should be the 'MIN' of 'bw_out_internal_limit' and + * 'bw_out_external_limit'. */ struct GNUNET_BANDWIDTH_Value32NBO bw_out; /** * Internal bandwidth limit set for this peer (initially typically - * set to "-1"). Actual "bw_out" is MIN of + * set to "MAX_INT"). Actual "bw_out" is MIN of * "bpm_out_internal_limit" and "bw_out_external_limit". + * + * + * * // FIXME: check usage */ struct GNUNET_BANDWIDTH_Value32NBO bw_out_internal_limit; @@ -773,26 +771,6 @@ GSC_SESSIONS_handle_client_request_info (void *cls, struct GNUNET_SERVER_Client } want_reserv = ntohl (rcm->reserve_inbound); - if (session->bw_out_internal_limit.value__ != rcm->limit_outbound.value__) - { - session->bw_out_internal_limit = rcm->limit_outbound; - if (session->bw_out.value__ != - GNUNET_BANDWIDTH_value_min (session->bw_out_internal_limit, - session->bw_out_external_limit).value__) - { - session->bw_out = - GNUNET_BANDWIDTH_value_min (session->bw_out_internal_limit, - session->bw_out_external_limit); - GNUNET_BANDWIDTH_tracker_update_quota (&session->available_recv_window, - session->bw_out); -#if 0 - // FIXME: who does this? - GNUNET_TRANSPORT_set_quota (transport, &session->peer, - session->bw_in, - session->bw_out); -#endif - } - } if (want_reserv < 0) { got_reserv = want_reserv;