diff options
author | David Goulet <dgoulet@torproject.org> | 2024-10-16 09:05:33 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2024-10-16 09:05:33 -0400 |
commit | cb2b4f5d5c8ecd27830dd0b0a405d2807d806020 (patch) | |
tree | 23cdd347c85be683977dc292f6c84f939a4a5b8f | |
parent | d1eea43d9363be26f9acc8219e6803531ba8b715 (diff) | |
parent | 7cca6dc1a36ff201eaab62a11699259e3ef9ce22 (diff) | |
download | tor-cb2b4f5d5c8ecd27830dd0b0a405d2807d806020.tar.gz tor-cb2b4f5d5c8ecd27830dd0b0a405d2807d806020.zip |
Merge branch 'maint-0.4.8' into release-0.4.8
-rw-r--r-- | changes/bug40981 | 9 | ||||
-rw-r--r-- | src/core/or/circuituse.c | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/changes/bug40981 b/changes/bug40981 new file mode 100644 index 0000000000..7979685c35 --- /dev/null +++ b/changes/bug40981 @@ -0,0 +1,9 @@ + o Major bugfixes (circuit building): + - Conflux circuit building was ignoring the "predicted ports" feature, + which aims to make Tor stop building circuits if there have been + no user requests lately. This bug led to every idle Tor on the + network building and discarding circuits every 30 seconds, which + added overall load to the network, used bandwidth and battery from + clients that weren't actively using their Tor, and kept sockets open + on guards which added connection padding essentially forever. Fixes + bug 40981; bugfix on 0.4.8.1-alpha; diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c index ac9005e1d4..abfb51c662 100644 --- a/src/core/or/circuituse.c +++ b/src/core/or/circuituse.c @@ -1202,8 +1202,13 @@ circuit_predict_and_launch_new(void) int flags = 0; /* Attempt to launch predicted conflux circuits. This is outside the HS or - * Exit preemptive circuit set. */ - conflux_predict_new(now); + * Exit preemptive circuit set. + * As with the other types of preemptive circuits, we only want to + * launch them if we have predicted ports. (If we haven't needed a + * circuit for a while, maybe we won't need one soon either.) */ + if (predicted_ports_prediction_time_remaining(now)) { + conflux_predict_new(now); + } /* Count how many of each type of circuit we currently have. */ SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *, circ) { |