diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-09-04 16:04:47 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-09-04 16:04:47 -0400 |
commit | 3cebc5e73c2db10bbe2c2259e3f4dd1c57d39afa (patch) | |
tree | 27223037f82a6610c2119ba47f85768d001758d4 | |
parent | 8611195a005ed1624bdea0632404a8c00bb19586 (diff) | |
parent | 4f3dbb3c0a5c1a6d7d8571add3722e6c567e3d81 (diff) | |
download | tor-3cebc5e73c2db10bbe2c2259e3f4dd1c57d39afa.tar.gz tor-3cebc5e73c2db10bbe2c2259e3f4dd1c57d39afa.zip |
Merge branch 'bug9671_023' into maint-0.2.3
-rw-r--r-- | changes/bug9671_023 | 5 | ||||
-rw-r--r-- | src/or/circuitbuild.c | 2 | ||||
-rw-r--r-- | src/or/circuitbuild.h | 1 | ||||
-rw-r--r-- | src/or/circuituse.c | 4 |
4 files changed, 9 insertions, 3 deletions
diff --git a/changes/bug9671_023 b/changes/bug9671_023 new file mode 100644 index 0000000000..035ca5cdea --- /dev/null +++ b/changes/bug9671_023 @@ -0,0 +1,5 @@ + o Major bugfixes: + - If the circuit build timeout logic is disabled (via the consensus, + or because we are an authority), then don't build testing circuits. + Fixes bug 9657; bugfix on 0.2.2.14-alpha. + diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index f8521c5cff..1c692ab87b 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -147,7 +147,7 @@ static void pathbias_count_success(origin_circuit_t *circ); * 3. If we are a directory authority * 4. If we fail to write circuit build time history to our state file. */ -static int +int circuit_build_times_disabled(void) { if (unit_tests) { diff --git a/src/or/circuitbuild.h b/src/or/circuitbuild.h index 984d04a99e..fc6ca65fca 100644 --- a/src/or/circuitbuild.h +++ b/src/or/circuitbuild.h @@ -32,6 +32,7 @@ char *circuit_list_path_for_controller(origin_circuit_t *circ); void circuit_log_path(int severity, unsigned int domain, origin_circuit_t *circ); void circuit_rep_hist_note_result(origin_circuit_t *circ); +int circuit_build_times_disabled(void); origin_circuit_t *origin_circuit_init(uint8_t purpose, int flags); origin_circuit_t *circuit_establish_circuit(uint8_t purpose, extend_info_t *exit, diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 20f124eb4e..ade4224fe5 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -746,7 +746,7 @@ circuit_predict_and_launch_new(void) * want, don't do another -- we want to leave a few slots open so * we can still build circuits preemptively as needed. */ if (num < MAX_UNUSED_OPEN_CIRCUITS-2 && - get_options()->LearnCircuitBuildTimeout && + ! circuit_build_times_disabled() && circuit_build_times_needs_circuits_now(&circ_times)) { flags = CIRCLAUNCH_NEED_CAPACITY; log_info(LD_CIRC, @@ -882,7 +882,7 @@ circuit_expire_old_circuits_clientside(void) tor_gettimeofday(&now); cutoff = now; - if (get_options()->LearnCircuitBuildTimeout && + if (! circuit_build_times_disabled() && circuit_build_times_needs_circuits(&circ_times)) { /* Circuits should be shorter lived if we need more of them * for learning a good build timeout */ |