summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-06-11 14:44:26 -0400
committerNick Mathewson <nickm@torproject.org>2012-06-11 14:44:26 -0400
commitf0f70ba6f1e484a5217952238b22467ba4939d8a (patch)
tree67e40f60065f1ac479537c6bbefda8deeba7cbab
parenta6dac69aaca088b5cbb8f8914673de03864d95b7 (diff)
parentb44cb4aef8e76131c59a9e8647936bd9d2cf6e18 (diff)
downloadtor-f0f70ba6f1e484a5217952238b22467ba4939d8a.tar.gz
tor-f0f70ba6f1e484a5217952238b22467ba4939d8a.zip
Merge branch 'bug5452'
-rw-r--r--changes/bug54524
-rw-r--r--src/or/config.c18
2 files changed, 22 insertions, 0 deletions
diff --git a/changes/bug5452 b/changes/bug5452
new file mode 100644
index 0000000000..8e1d9adf7b
--- /dev/null
+++ b/changes/bug5452
@@ -0,0 +1,4 @@
+ o Minor features:
+ - Check CircuitBuildTimeout and LearnCircuitBuildTimeout in
+ options_validate(); warn if LearnCircuitBuildTimeout is disabled
+ and CircuitBuildTimeout is set unreasonably low. Fixes bug 5452.
diff --git a/src/or/config.c b/src/or/config.c
index 1fc5806f11..09fcf000be 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -3320,6 +3320,13 @@ compute_publishserverdescriptor(or_options_t *options)
* expose more information than we're comfortable with. */
#define MIN_HEARTBEAT_PERIOD (30*60)
+/** Lowest recommended value for CircuitBuildTimeout; if it is set too low
+ * and LearnCircuitBuildTimeout is off, the failure rate for circuit
+ * construction may be very high. In that case, if it is set below this
+ * threshold emit a warning.
+ * */
+#define RECOMMENDED_MIN_CIRCUIT_BUILD_TIMEOUT (10)
+
/** Return 0 if every setting in <b>options</b> is reasonable, and a
* permissible transition from <b>old_options</b>. Else return -1.
* Should have no side effects, except for normalizing the contents of
@@ -3716,6 +3723,17 @@ options_validate(or_options_t *old_options, or_options_t *options,
options->LearnCircuitBuildTimeout = 0;
}
+ if (!(options->LearnCircuitBuildTimeout) &&
+ options->CircuitBuildTimeout < RECOMMENDED_MIN_CIRCUIT_BUILD_TIMEOUT) {
+ log_warn(LD_CONFIG,
+ "CircuitBuildTimeout is shorter (%d seconds) than recommended "
+ "(%d seconds), and LearnCircuitBuildTimeout is disabled. "
+ "If tor isn't working, raise this value or enable "
+ "LearnCircuitBuildTimeout.",
+ options->CircuitBuildTimeout,
+ RECOMMENDED_MIN_CIRCUIT_BUILD_TIMEOUT );
+ }
+
if (options->MaxCircuitDirtiness < MIN_MAX_CIRCUIT_DIRTINESS) {
log_warn(LD_CONFIG, "MaxCircuitDirtiness option is too short; "
"raising to %d seconds.", MIN_MAX_CIRCUIT_DIRTINESS);