diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-01-26 13:35:00 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-01-26 13:35:00 -0500 |
commit | 0755bcc36ac81e4a7d569b67f5e5a2267ed47620 (patch) | |
tree | 4fa32507c33e517e3173352ece9d3c180f603ff0 /src/or/circuituse.c | |
parent | 7a74b3663fdaa40fc84e48990d15953a8f46a2bf (diff) | |
download | tor-0755bcc36ac81e4a7d569b67f5e5a2267ed47620.tar.gz tor-0755bcc36ac81e4a7d569b67f5e5a2267ed47620.zip |
Remove a needless (always-true) check.
Also add an assertion and rename a variable.
Closes ticekt 24927.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 1ff1de4650..3a14a3ccfc 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -1773,7 +1773,8 @@ circuit_build_failed(origin_circuit_t *circ) /* We failed at the first hop for some reason other than a DESTROY cell. * If there's an OR connection to blame, blame it. Also, avoid this relay * for a while, and fail any one-hop directory fetches destined for it. */ - const char *n_chan_id = circ->cpath->extend_info->identity_digest; + const char *n_chan_ident = circ->cpath->extend_info->identity_digest; + tor_assert(n_chan_ident); int already_marked = 0; if (circ->base_.n_chan) { n_chan = circ->base_.n_chan; @@ -1801,7 +1802,7 @@ circuit_build_failed(origin_circuit_t *circ) "with no connection", TO_CIRCUIT(circ)->n_circ_id, circ->global_identifier); } - if (n_chan_id && !already_marked) { + if (!already_marked) { /* * If we have guard state (new guard API) and our path selection * code actually chose a full path, then blame the failure of this @@ -1821,7 +1822,7 @@ circuit_build_failed(origin_circuit_t *circ) entry_guard_failed(&circ->guard_state); /* 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); + connection_ap_fail_onehop(n_chan_ident, circ->build_state); } } |