diff options
author | unixninja92 <charlesvt@gmail.com> | 2013-09-25 01:45:00 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-03-05 14:31:13 -0500 |
commit | 5c310a4fa2c13a52dc3fd39368788c3e75be6cb0 (patch) | |
tree | b82ab69b88d775c41549f530c2c635ef518d12e9 /src/or/config.c | |
parent | 52fbb9f623505a29975bea971478fc1e65591575 (diff) | |
download | tor-5c310a4fa2c13a52dc3fd39368788c3e75be6cb0.tar.gz tor-5c310a4fa2c13a52dc3fd39368788c3e75be6cb0.zip |
Added max value to PredictedCircsRelevanceTime.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index 460bf3ec41..11320746a2 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -2385,6 +2385,11 @@ compute_publishserverdescriptor(or_options_t *options) * services can overload the directory system. */ #define MIN_REND_POST_PERIOD (10*60) +/** Higest allowable value for PredictedCircsRelevanceTime; if this is + * too high, our selection of exits will decrease for an extended + * period of time to an uncomfortable level .*/ +#define MAX_PREDICTED_CIRCS_RELEVANCE (24*60*60) + /** Highest allowable value for RendPostPeriod. */ #define MAX_DIR_PERIOD (MIN_ONION_KEY_LIFETIME/2) @@ -2832,6 +2837,13 @@ options_validate(or_options_t *old_options, or_options_t *options, options->RendPostPeriod = MAX_DIR_PERIOD; } + if (options->PredictedCircsRelevanceTime > + MAX_PREDICTED_CIRCS_RELEVANCE) { + log_warn(LD_CONFIG, "PredictedCircsRelevanceTime is too large; " + "clipping to %ds.", MAX_PREDICTED_CIRCS_RELEVANCE); + options->PredictedCircsRelevanceTime = MAX_PREDICTED_CIRCS_RELEVANCE; + } + if (options->Tor2webMode && options->LearnCircuitBuildTimeout) { /* LearnCircuitBuildTimeout and Tor2webMode are incompatible in * two ways: |