|
@@ -2943,6 +2943,10 @@ compute_publishserverdescriptor(or_options_t *options)
|
|
|
* will generate too many circuits and potentially overload the network. */
|
|
|
#define MIN_MAX_CIRCUIT_DIRTINESS 10
|
|
|
|
|
|
+/** Lowest allowable value for CircuitStreamTimeout; if this is too low, Tor
|
|
|
+ * will generate too many circuits and potentially overload the network. */
|
|
|
+#define MIN_CIRCUIT_STREAM_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
|
|
@@ -3374,23 +3378,30 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
|
|
}
|
|
|
|
|
|
if (options->RendPostPeriod < MIN_REND_POST_PERIOD) {
|
|
|
- log(LOG_WARN,LD_CONFIG,"RendPostPeriod option is too short; "
|
|
|
- "raising to %d seconds.", MIN_REND_POST_PERIOD);
|
|
|
+ log_warn(LD_CONFIG, "RendPostPeriod option is too short; "
|
|
|
+ "raising to %d seconds.", MIN_REND_POST_PERIOD);
|
|
|
options->RendPostPeriod = MIN_REND_POST_PERIOD;
|
|
|
}
|
|
|
|
|
|
if (options->RendPostPeriod > MAX_DIR_PERIOD) {
|
|
|
- log(LOG_WARN, LD_CONFIG, "RendPostPeriod is too large; clipping to %ds.",
|
|
|
- MAX_DIR_PERIOD);
|
|
|
+ log_warn(LD_CONFIG, "RendPostPeriod is too large; clipping to %ds.",
|
|
|
+ MAX_DIR_PERIOD);
|
|
|
options->RendPostPeriod = MAX_DIR_PERIOD;
|
|
|
}
|
|
|
|
|
|
if (options->MaxCircuitDirtiness < MIN_MAX_CIRCUIT_DIRTINESS) {
|
|
|
- log(LOG_WARN, LD_CONFIG, "MaxCircuitDirtiness option is too short; "
|
|
|
- "raising to %d seconds.", MIN_MAX_CIRCUIT_DIRTINESS);
|
|
|
+ log_warn(LD_CONFIG, "MaxCircuitDirtiness option is too short; "
|
|
|
+ "raising to %d seconds.", MIN_MAX_CIRCUIT_DIRTINESS);
|
|
|
options->MaxCircuitDirtiness = MIN_MAX_CIRCUIT_DIRTINESS;
|
|
|
}
|
|
|
|
|
|
+ if (options->CircuitStreamTimeout &&
|
|
|
+ options->CircuitStreamTimeout < MIN_CIRCUIT_STREAM_TIMEOUT) {
|
|
|
+ log_warn(LD_CONFIG, "CircuitStreamTimeout option is too short; "
|
|
|
+ "raising to %d seconds.", MIN_CIRCUIT_STREAM_TIMEOUT);
|
|
|
+ options->CircuitStreamTimeout = MIN_CIRCUIT_STREAM_TIMEOUT;
|
|
|
+ }
|
|
|
+
|
|
|
if (options->KeepalivePeriod < 1)
|
|
|
REJECT("KeepalivePeriod option must be positive.");
|
|
|
|