summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-11-19 06:57:44 +0000
committerRoger Dingledine <arma@torproject.org>2005-11-19 06:57:44 +0000
commit7aae63994f7d8b42ff7b9b4809eb2f1213372148 (patch)
treec8794fc5446a4012ff83ee805d3e5627e61cc374 /src/or/circuituse.c
parent700c370a3b9f30495983301883d678ef90bb1621 (diff)
downloadtor-7aae63994f7d8b42ff7b9b4809eb2f1213372148.tar.gz
tor-7aae63994f7d8b42ff7b9b4809eb2f1213372148.zip
Recover better from TCP connections to Tor servers that are broken but
don't tell you (it happens!); and rotate TLS connections once a week. 1) If an OR conn becomes more than a week old, make it obsolete. 2) If it's obsolete and empty, kill it. 3) When an OR makes a second connection to you, allow it. 4) If we want to send a new create cell, but the best conn we've got is obsolete, and the router is 0.1.1.9-alpha-cvs or later, ask for a new conn instead. 5) When we time out on circuit building on the first hop, make that connection obsolete. svn:r5429
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index d46537ace7..780c8c0fd3 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -654,7 +654,17 @@ circuit_build_failed(circuit_t *circ)
if (circ->cpath &&
circ->cpath->prev->state != CPATH_STATE_OPEN &&
circ->cpath->prev->prev->state == CPATH_STATE_OPEN) {
- failed_at_last_hop = 1;
+ failed_at_last_hop = 1;
+ }
+ if (circ->cpath &&
+ circ->cpath->state != CPATH_STATE_OPEN) {
+ /* We failed at the first hop. If there's an OR connection
+ to blame, blame it. */
+ if (circ->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;
+ }
}
switch (circ->purpose) {