aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-05-18 10:06:27 -0400
committerNick Mathewson <nickm@torproject.org>2017-05-18 10:06:27 -0400
commitb214c2c0955373bdf0eab6954c19dd9b559200cf (patch)
tree2f5cc8de4ca63b7f9c4087448ce4693cda15b84a /src/or
parente04da2828d6bbf1499d3df5ba85a8baf4c485bb7 (diff)
parent935cd77f62f036e615923742de278398aa85f2bf (diff)
downloadtor-b214c2c0955373bdf0eab6954c19dd9b559200cf.tar.gz
tor-b214c2c0955373bdf0eab6954c19dd9b559200cf.zip
Merge branch 'maint-0.3.0'
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuitstats.c11
-rw-r--r--src/or/circuitstats.h3
-rw-r--r--src/or/config.c2
3 files changed, 14 insertions, 2 deletions
diff --git a/src/or/circuitstats.c b/src/or/circuitstats.c
index fe6f723bd5..51d580a1a4 100644
--- a/src/or/circuitstats.c
+++ b/src/or/circuitstats.c
@@ -107,10 +107,19 @@ get_circuit_build_timeout_ms(void)
int
circuit_build_times_disabled(const or_options_t *options)
{
+ return circuit_build_times_disabled_(options, 0);
+}
+
+/** As circuit_build_times_disabled, but take options as an argument. */
+int
+circuit_build_times_disabled_(const or_options_t *options,
+ int ignore_consensus)
+{
if (unit_tests) {
return 0;
} else {
- int consensus_disabled = networkstatus_get_param(NULL, "cbtdisabled",
+ int consensus_disabled =
+ ignore_consensus ? 0 : networkstatus_get_param(NULL, "cbtdisabled",
0, 0, 1);
int config_disabled = !options->LearnCircuitBuildTimeout;
int dirauth_disabled = options->AuthoritativeDir;
diff --git a/src/or/circuitstats.h b/src/or/circuitstats.h
index 4977b26c0d..8a1dec4bfd 100644
--- a/src/or/circuitstats.h
+++ b/src/or/circuitstats.h
@@ -18,6 +18,9 @@ double get_circuit_build_close_time_ms(void);
double get_circuit_build_timeout_ms(void);
int circuit_build_times_disabled(const or_options_t *options);
+int circuit_build_times_disabled_(const or_options_t *options,
+ int ignore_consensus);
+
int circuit_build_times_enough_to_compute(const circuit_build_times_t *cbt);
void circuit_build_times_update_state(const circuit_build_times_t *cbt,
or_state_t *state);
diff --git a/src/or/config.c b/src/or/config.c
index 09d558e1b4..784ae0c458 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -3490,7 +3490,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
int severity = LOG_NOTICE;
/* Be a little quieter if we've deliberately disabled
* LearnCircuitBuildTimeout. */
- if (circuit_build_times_disabled(options)) {
+ if (circuit_build_times_disabled_(options, 1)) {
severity = LOG_INFO;
}
log_fn(severity, LD_CONFIG, "You disabled LearnCircuitBuildTimeout, but "