summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@persephoneslair.org>2012-06-12 12:12:06 -0700
committerNick Mathewson <nickm@torproject.org>2012-06-13 16:45:12 -0400
commit0c3c0b1ddd97d9bad4d7a0e875ef46729245ffda (patch)
treef9d33aa9bd0e1101d6252b55600277d2d1451025
parenta0f76289fd8b778dd6a46c8726fddfc15d68193d (diff)
downloadtor-0c3c0b1ddd97d9bad4d7a0e875ef46729245ffda.tar.gz
tor-0c3c0b1ddd97d9bad4d7a0e875ef46729245ffda.zip
Don't poll to see if we need to build circuits for timeout data if LearnCircuitBuildTimeout is disabled
-rw-r--r--src/or/circuituse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index f43ce19c83..7532c4e923 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -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;