diff options
author | Roger Dingledine <arma@torproject.org> | 2009-01-06 21:31:46 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2009-01-06 21:31:46 +0000 |
commit | cdda852cecee198431291537ce4da86bc67cdd8f (patch) | |
tree | 6c581225ceb76f457a844f625c275c50b6cb57cc | |
parent | b36a98ff5a03b316ba781486faabf31ab83b15fa (diff) | |
download | tor-cdda852cecee198431291537ce4da86bc67cdd8f.tar.gz tor-cdda852cecee198431291537ce4da86bc67cdd8f.zip |
simplify. no actual changes i think. ;)
svn:r17985
-rw-r--r-- | src/or/circuituse.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 84aae1768c..dd200e105f 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -801,32 +801,19 @@ circuit_build_failed(origin_circuit_t *circ) circ->cpath->state != CPATH_STATE_OPEN) { /* We failed at the first hop. If there's an OR connection to blame, blame it. */ - or_connection_t *n_conn = NULL; const char *n_conn_id = circ->_base.n_hop->identity_digest; if (circ->_base.n_conn) { - n_conn = circ->_base.n_conn; - if (n_conn) n_conn_id = n_conn->identity_digest; - } else if (circ->_base.state == CIRCUIT_STATE_OR_WAIT && - circ->_base.n_hop) { - n_conn_id = circ->_base.n_hop->identity_digest; - /* Do not set n_conn. If we're in state_or_wait, it's wrong to blame a - * particular connection for our failure to extend and set its - * is_bad_for_new_circs field, since no connection ever got a chance to - * hear our CREATE cell. */ - } - if (n_conn) { + or_connection_t *n_conn = circ->_base.n_conn; log_info(LD_OR, "Our circuit failed to get a response from the first hop " "(%s:%d). I'm going to try to rotate to a better connection.", n_conn->_base.address, n_conn->_base.port); n_conn->is_bad_for_new_circs = 1; } - if (n_conn_id) { - entry_guard_register_connect_status(n_conn_id, 0, time(NULL)); - /* if there are any one-hop streams waiting on this circuit, fail - * them now so they can retry elsewhere. */ - connection_ap_fail_onehop(n_conn_id, circ->build_state); - } + entry_guard_register_connect_status(n_conn_id, 0, time(NULL)); + /* if there are any one-hop streams waiting on this circuit, fail + * them now so they can retry elsewhere. */ + connection_ap_fail_onehop(n_conn_id, circ->build_state); } switch (circ->_base.purpose) { |