aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2010-09-28 22:32:38 -0400
committerRoger Dingledine <arma@torproject.org>2010-09-28 22:32:38 -0400
commit9997676802c140aceddb849090c7b3795fc83361 (patch)
tree66cdff441b840e2405f146bc6b32a37cce35849a /src/or/circuitbuild.c
parent7de1caa33f025db5474dba5f7e256d28c5ab4969 (diff)
downloadtor-9997676802c140aceddb849090c7b3795fc83361.tar.gz
tor-9997676802c140aceddb849090c7b3795fc83361.zip
handle ugly edge case in retrying entrynodes
Specifically, a circ attempt that we'd launched while the network was down could timeout after we've marked our entrynodes up, marking them back down again. The fix is to annotate as bad the OR conns that were around before we did the retry, so if a circuit that's attached to them times out we don't do anything about it.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index a9920e2bcb..dd92e78cb5 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -4604,7 +4604,16 @@ entries_retry_helper(or_options_t *options, int act)
any_known = 1;
if (ri->is_running)
any_running = 1; /* some entry is both known and running */
- else if (act) { /* mark it for retry */
+ else if (act) {
+ /* Mark-for-close all TLS connections to this node, since
+ * otherwise there could be one that started 30 seconds
+ * ago, and in 30 seconds it will time out, causing us to mark
+ * the node down and undermine the retry attempt. We mark even
+ * the established conns, since if the network just came back
+ * we'll want to attach circuits to fresh conns. */
+ connection_or_set_bad_connections(ri->cache_info.identity_digest, 1);
+
+ /* mark it for retry */
router_set_status(ri->cache_info.identity_digest, 1);
e->can_retry = 1;
e->bad_since = 0;