summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-04-30 09:18:48 +0000
committerRoger Dingledine <arma@torproject.org>2007-04-30 09:18:48 +0000
commit7fb4365cd3286f8fc41f6d588c12f6f7baa4b39b (patch)
tree2e8099117b3f6359d831185462eea5d0c5d2630e /src/or/circuituse.c
parent313ac313be7189860114fdd31fcaab1b0de7393a (diff)
downloadtor-7fb4365cd3286f8fc41f6d588c12f6f7baa4b39b.tar.gz
tor-7fb4365cd3286f8fc41f6d588c12f6f7baa4b39b.zip
Add a new config option __DisablePredictedCircuits designed for
use by the controller, when we don't want Tor to build any circuits preemptively. svn:r10054
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 8b3e1a8f14..6bfe087100 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -448,6 +448,7 @@ void
circuit_build_needed_circs(time_t now)
{
static long time_to_new_circuit = 0;
+ or_options_t *options = get_options();
/* launch a new circ for any pending streams that need one */
connection_ap_attach_pending();
@@ -457,7 +458,7 @@ circuit_build_needed_circs(time_t now)
if (time_to_new_circuit < now) {
circuit_reset_failure_count(1);
- time_to_new_circuit = now + get_options()->NewCircuitPeriod;
+ time_to_new_circuit = now + options->NewCircuitPeriod;
if (proxy_mode(get_options()))
addressmap_clean(now);
circuit_expire_old_circuits(now);
@@ -472,7 +473,8 @@ circuit_build_needed_circs(time_t now)
}
#endif
}
- circuit_predict_and_launch_new();
+ if (!options->DisablePredictedCircuits)
+ circuit_predict_and_launch_new();
}
/** If the stream <b>conn</b> is a member of any of the linked