summaryrefslogtreecommitdiff
path: root/src/or/relay.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-02-21 09:00:54 +0000
committerRoger Dingledine <arma@torproject.org>2008-02-21 09:00:54 +0000
commita60f7caa5490a38bd67d01ae65fb08c51250cd87 (patch)
tree2960a01b5d359b1a7ba823e3628d0cee536fdc09 /src/or/relay.c
parent18a209ffe6580115124ba08e125ff77c9478dcfb (diff)
downloadtor-a60f7caa5490a38bd67d01ae65fb08c51250cd87.tar.gz
tor-a60f7caa5490a38bd67d01ae65fb08c51250cd87.zip
start allowing clients to give up on trackhostexits targets if
five circuit attempts fail for a given stream. part of the fix for bug 437. still an XXX020rc remaining. svn:r13648
Diffstat (limited to 'src/or/relay.c')
-rw-r--r--src/or/relay.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 0dc79e4488..9b3052b392 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -771,9 +771,18 @@ connection_edge_process_end_not_open(
NULL)) {
control_event_stream_status(conn, STREAM_EVENT_REMAP, 0);
}
- if (conn->_base.chosen_exit_optional) {
+ if (conn->_base.chosen_exit_optional ||
+ conn->_base.chosen_exit_retries) {
/* stop wanting a specific exit */
conn->_base.chosen_exit_optional = 0;
+ /* A non-zero chosen_exit_retries can happen if we set a
+ * TrackHostExits for this address under a port that the exit
+ * relay allows, but then try the same address with a different
+ * port that it doesn't allow to exit. We shouldn't unregister
+ * the mapping, since it is probably still wanted on the
+ * original port. But now we give away to the exit relay that
+ * we probably have a TrackHostExits on it. So be it. */
+ conn->_base.chosen_exit_retries = 0;
tor_free(conn->chosen_exit_name); /* clears it */
}
if (connection_ap_detach_retriable(conn, circ, control_reason) >= 0)