commit 3f9b7681780d56a59ceec319774ff2a7b3893bb5
parent 0299dc4aa1e710604098f7d12b37f1a4d24fa38c
Author: Alexander Hansen Færøy <ahf@torproject.org>
Date: Tue, 6 May 2025 22:13:24 +0200
Merge branch 'ticket41064' into 'main'
Use RELAY_PAYLOAD_SIZE_MIN for some cc calculations
Closes #41064
See merge request tpo/core/tor!890
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/core/or/congestion_control_flow.c b/src/core/or/congestion_control_flow.c
@@ -71,15 +71,13 @@ double cc_stats_flow_xon_outbuf_ma = 0;
void
flow_control_new_consensus_params(const networkstatus_t *ns)
{
- // TODO CGO: These numbers might be wrong for the v1 cell format!
-
#define CC_XOFF_CLIENT_DFLT 500
#define CC_XOFF_CLIENT_MIN 1
#define CC_XOFF_CLIENT_MAX 10000
xoff_client = networkstatus_get_param(ns, "cc_xoff_client",
CC_XOFF_CLIENT_DFLT,
CC_XOFF_CLIENT_MIN,
- CC_XOFF_CLIENT_MAX)*RELAY_PAYLOAD_SIZE_MAX;
+ CC_XOFF_CLIENT_MAX)*RELAY_PAYLOAD_SIZE_MIN;
#define CC_XOFF_EXIT_DFLT 500
#define CC_XOFF_EXIT_MIN 1
@@ -87,7 +85,7 @@ flow_control_new_consensus_params(const networkstatus_t *ns)
xoff_exit = networkstatus_get_param(ns, "cc_xoff_exit",
CC_XOFF_EXIT_DFLT,
CC_XOFF_EXIT_MIN,
- CC_XOFF_EXIT_MAX)*RELAY_PAYLOAD_SIZE_MAX;
+ CC_XOFF_EXIT_MAX)*RELAY_PAYLOAD_SIZE_MIN;
#define CC_XON_CHANGE_PCT_DFLT 25
#define CC_XON_CHANGE_PCT_MIN 1
@@ -479,8 +477,7 @@ flow_control_decide_xoff(edge_connection_t *stream)
* do this because writes only happen when the socket unblocks, so
* may not otherwise notice accumulation of data in the outbuf for
* advisory XONs. */
- // TODO CGO: This might be wrong for the v1 cell format!
- if (total_buffered > MAX_EXPECTED_CELL_BURST*RELAY_PAYLOAD_SIZE_MAX) {
+ if (total_buffered > MAX_EXPECTED_CELL_BURST*RELAY_PAYLOAD_SIZE_MIN) {
flow_control_decide_xon(stream, 0);
}