diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-12-07 12:36:13 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-16 11:06:22 -0500 |
commit | 68679504323b0a676a446b8fb34b976c9dc66b4f (patch) | |
tree | 89a6a9621fae80e4c41114aee2d0f12aed437dcb /src/or/circuituse.c | |
parent | 2b4bfe62ee74b927d65923f5d07fe04f51f8779a (diff) | |
download | tor-68679504323b0a676a446b8fb34b976c9dc66b4f.tar.gz tor-68679504323b0a676a446b8fb34b976c9dc66b4f.zip |
Wrap all of the legacy guard code, and its users, in #ifdefs
This will make it easier to see what we remove down the line.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 787c490387..8e0fbd1d39 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -550,16 +550,14 @@ circuit_expire_building(void) == 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). " - "%d guards are live.", + "(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), - channel_state_to_string(victim->n_chan->state), - num_live_entry_guards(0)); + channel_state_to_string(victim->n_chan->state)); /* We count the timeout here for CBT, because technically this * was a timeout, and the timeout value needs to reset if we @@ -577,7 +575,7 @@ circuit_expire_building(void) "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 " - "anyway. %d guards are live.", + "anyway.", TO_ORIGIN_CIRCUIT(victim)->global_identifier, circuit_purpose_to_string(victim->purpose), TO_ORIGIN_CIRCUIT(victim)->build_state ? @@ -585,8 +583,7 @@ circuit_expire_building(void) -1, circuit_state_to_string(victim->state), channel_state_to_string(victim->n_chan->state), - (long)build_close_ms, - num_live_entry_guards(0)); + (long)build_close_ms); } } @@ -1655,8 +1652,10 @@ circuit_build_failed(origin_circuit_t *circ) /* New guard API: we failed. */ if (circ->guard_state) entry_guard_failed(&circ->guard_state); +#ifdef ENABLE_LEGACY_GUARD_ALGORITHM /* Old guard API: we failed. */ entry_guard_register_connect_status(n_chan_id, 0, 1, time(NULL)); +#endif /* if there are any one-hop streams waiting on this circuit, fail * them now so they can retry elsewhere. */ connection_ap_fail_onehop(n_chan_id, circ->build_state); @@ -1966,7 +1965,7 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn, int severity = LOG_NOTICE; /* Retry some stuff that might help the connection work. */ if (entry_list_is_constrained(options) && - entries_known_but_down(options)) { + guards_retry_optimistic(options)) { log_fn(severity, LD_APP|LD_DIR, "Application request when we haven't %s. " "Optimistically trying known %s again.", @@ -1974,7 +1973,6 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn, "used client functionality lately" : "received a consensus with exits", options->UseBridges ? "bridges" : "entrynodes"); - entries_retry_all(options); } else if (!options->UseBridges || any_bridge_descriptors_known()) { log_fn(severity, LD_APP|LD_DIR, "Application request when we haven't %s. " |