]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
core/or: Lift slow call out of loop, #33977
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>
Thu, 23 Apr 2020 17:24:08 +0000 (13:24 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 5 May 2020 19:07:42 +0000 (15:07 -0400)
changes/bug33977 [new file with mode: 0644]
src/core/or/circuituse.c

diff --git a/changes/bug33977 b/changes/bug33977
new file mode 100644 (file)
index 0000000..b424a81
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfix (refactoring):
+    - Lift circuit_build_times_disabled out of circuit_expire_building loop to
+      save CPU time with many circuits open. Fixes bug 33977; bugfix on
+      0.3.5.9.
index 066d5d437aa9730adb60742db3c7740aa8d68108..419ad07f716a0f730130d65cfdf242a0b3357494 100644 (file)
@@ -548,9 +548,10 @@ circuit_expire_building(void)
              MAX(get_circuit_build_close_time_ms()*2 + 1000,
                  options->SocksTimeout * 1000));
 
+  bool fixed_time = circuit_build_times_disabled(get_options());
+
   SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *,victim) {
     struct timeval cutoff;
-    bool fixed_time = circuit_build_times_disabled(get_options());
 
     if (!CIRCUIT_IS_ORIGIN(victim) || /* didn't originate here */
         victim->marked_for_close)     /* don't mess with marked circs */