diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-02-19 11:27:18 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-02-19 11:27:18 -0500 |
commit | 26873bc4edb057041e5cc130ec90f4fbc2d8beb8 (patch) | |
tree | a1d40eaad4d56b5f4114d887961199bdd22a15a2 | |
parent | 5c87add923d14c90db8c84cca843754e7715df9e (diff) | |
parent | 78220aae1ed3994453413559ff8b068578b31818 (diff) | |
download | tor-26873bc4edb057041e5cc130ec90f4fbc2d8beb8.tar.gz tor-26873bc4edb057041e5cc130ec90f4fbc2d8beb8.zip |
Merge branch 'bug28698_035' into maint-0.4.0
-rw-r--r-- | changes/bug28698 | 3 | ||||
-rw-r--r-- | src/core/or/circuituse.c | 30 |
2 files changed, 21 insertions, 12 deletions
diff --git a/changes/bug28698 b/changes/bug28698 new file mode 100644 index 0000000000..716aa0c552 --- /dev/null +++ b/changes/bug28698 @@ -0,0 +1,3 @@ + o Minor bugfix (logging): + - Avoid logging about relaxing circuits when their time is fixed. + Fixes bug 28698; bugfix on 0.2.4.7-alpha diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c index 07b7db93f6..2fdf6f7e8c 100644 --- a/src/core/or/circuituse.c +++ b/src/core/or/circuituse.c @@ -546,6 +546,8 @@ circuit_expire_building(void) SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *,victim) { struct timeval cutoff; + bool fixed_time = circuit_build_times_disabled(get_options()); + if (!CIRCUIT_IS_ORIGIN(victim) || /* didn't originate here */ victim->marked_for_close) /* don't mess with marked circs */ continue; @@ -600,17 +602,19 @@ circuit_expire_building(void) if (!TO_ORIGIN_CIRCUIT(victim)->relaxed_timeout) { int first_hop_succeeded = TO_ORIGIN_CIRCUIT(victim)->cpath->state == CPATH_STATE_OPEN; - log_info(LD_CIRC, - "No circuits are opened. Relaxing timeout for circuit %d " - "(a %s %d-hop circuit in state %s with channel state %s).", - TO_ORIGIN_CIRCUIT(victim)->global_identifier, - circuit_purpose_to_string(victim->purpose), - TO_ORIGIN_CIRCUIT(victim)->build_state ? - TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len : - -1, - circuit_state_to_string(victim->state), - victim->n_chan ? - channel_state_to_string(victim->n_chan->state) : "none"); + if (!fixed_time) { + log_info(LD_CIRC, + "No circuits are opened. Relaxing timeout for circuit %d " + "(a %s %d-hop circuit in state %s with channel state %s).", + TO_ORIGIN_CIRCUIT(victim)->global_identifier, + circuit_purpose_to_string(victim->purpose), + TO_ORIGIN_CIRCUIT(victim)->build_state ? + TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len : + -1, + circuit_state_to_string(victim->state), + victim->n_chan ? + channel_state_to_string(victim->n_chan->state) : "none"); + } /* We count the timeout here for CBT, because technically this * was a timeout, and the timeout value needs to reset if we @@ -624,7 +628,8 @@ circuit_expire_building(void) } else { static ratelim_t relax_timeout_limit = RATELIM_INIT(3600); const double build_close_ms = get_circuit_build_close_time_ms(); - log_fn_ratelim(&relax_timeout_limit, LOG_NOTICE, LD_CIRC, + if (!fixed_time) { + log_fn_ratelim(&relax_timeout_limit, LOG_NOTICE, LD_CIRC, "No circuits are opened. Relaxed timeout for circuit %d " "(a %s %d-hop circuit in state %s with channel state %s) to " "%ldms. However, it appears the circuit has timed out " @@ -638,6 +643,7 @@ circuit_expire_building(void) victim->n_chan ? channel_state_to_string(victim->n_chan->state) : "none", (long)build_close_ms); + } } } |