aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-12-27 09:25:50 +0000
committerRoger Dingledine <arma@torproject.org>2005-12-27 09:25:50 +0000
commitd2171cb7a4298c71a017cef925c7953092d99c3f (patch)
treecb75b5a8a98763c1cfa735baf3d0a5edfc60dadc
parent4088f7dfd1fa54762229a583080eda412e299ba4 (diff)
downloadtor-d2171cb7a4298c71a017cef925c7953092d99c3f.tar
tor-d2171cb7a4298c71a017cef925c7953092d99c3f.tar.gz
if the network is down, and we try to connect to a conn because we
have a circuit in mind, and we timeout (30 seconds) because the network never answers, we were expiring the circuit, but we weren't obsoleting the connection or telling the helper functions. now do that. svn:r5668
-rw-r--r--src/or/circuituse.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 5ac644232..d5eca281f 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -668,12 +668,19 @@ circuit_build_failed(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. */
+ connection_t *n_conn = NULL;
if (circ->n_conn) {
+ n_conn = circ->n_conn;
+ } else if (circ->state == CIRCUIT_STATE_OR_WAIT) {
+ /* we have to hunt for it */
+ n_conn = connection_or_get_by_identity_digest(circ->n_conn_id_digest);
+ }
+ if (n_conn) {
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.",
- circ->n_conn->address, circ->n_conn->port);
- circ->n_conn->is_obsolete = 1;
- helper_node_set_status(circ->n_conn->identity_digest, 0);
+ n_conn->address, n_conn->port);
+ n_conn->is_obsolete = 1;
+ helper_node_set_status(n_conn->identity_digest, 0);
}
}