]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't poll to see if we need to build circuits for timeout data if LearnCircuitBuildT...
authorAndrea Shepard <andrea@persephoneslair.org>
Tue, 12 Jun 2012 19:12:06 +0000 (12:12 -0700)
committerNick Mathewson <nickm@torproject.org>
Wed, 13 Jun 2012 20:45:12 +0000 (16:45 -0400)
src/or/circuituse.c

index f43ce19c836aaa64c79039091af693307b026dca..7532c4e923c11419d3f67e60fe2493bf61ae2063 100644 (file)
@@ -746,6 +746,7 @@ circuit_predict_and_launch_new(void)
    * want, don't do another -- we want to leave a few slots open so
    * we can still build circuits preemptively as needed. */
   if (num < MAX_UNUSED_OPEN_CIRCUITS-2 &&
+      get_options()->LearnCircuitBuildTimeout &&
       circuit_build_times_needs_circuits_now(&circ_times)) {
     flags = CIRCLAUNCH_NEED_CAPACITY;
     log_info(LD_CIRC,
@@ -881,7 +882,8 @@ circuit_expire_old_circuits_clientside(void)
   tor_gettimeofday(&now);
   cutoff = now;
 
-  if (circuit_build_times_needs_circuits(&circ_times)) {
+  if (get_options()->LearnCircuitBuildTimeout &&
+      circuit_build_times_needs_circuits(&circ_times)) {
     /* Circuits should be shorter lived if we need more of them
      * for learning a good build timeout */
     cutoff.tv_sec -= IDLE_TIMEOUT_WHILE_LEARNING;