]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Do not reset our RTT in slow start.
authorMike Perry <mikeperry-git@torproject.org>
Tue, 10 Jan 2023 20:47:11 +0000 (20:47 +0000)
committerMike Perry <mikeperry-git@torproject.org>
Tue, 10 Jan 2023 20:47:11 +0000 (20:47 +0000)
If a circuit only sends a tiny amount of data such that its cwnd is not
full, it won't increase its cwnd above the minimum. Since slow start circuits
should never hit the minimum otherwise, we can just ignore them for RTT reset
to handle this.

src/core/or/congestion_control_common.c

index e96d22cbfaaf1e165a5c02019bdf6095b844eb4e..f5b7740bedfa569dde5d92557769fb58c49506d0 100644 (file)
@@ -902,7 +902,7 @@ congestion_control_update_circuit_rtt(congestion_control_t *cc,
   if (cc->min_rtt_usec == 0) {
     // If we do not have a min_rtt yet, use current ewma
     cc->min_rtt_usec = cc->ewma_rtt_usec;
-  } else if (cc->cwnd == cc->cwnd_min) {
+  } else if (cc->cwnd == cc->cwnd_min && !cc->in_slow_start) {
     // Raise min rtt if cwnd hit cwnd_min. This gets us out of a wedge state
     // if we hit cwnd_min due to an abnormally low rtt.
     uint64_t new_rtt = percent_max_mix(cc->ewma_rtt_usec, cc->min_rtt_usec,