diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-12-25 23:30:28 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-12-25 23:30:28 -0500 |
commit | 885e8d35c7af65b3e1e598d6f2e951ba84e65928 (patch) | |
tree | 8babd1d1ce290fd98d43cc948a90001a05ca5c93 /src/or/relay.c | |
parent | 265aab298ad923425e136013f6c439b5fba32558 (diff) | |
parent | 406d59a9c93e46bcb5be0e0a5c087f4860522d56 (diff) | |
download | tor-885e8d35c7af65b3e1e598d6f2e951ba84e65928.tar tor-885e8d35c7af65b3e1e598d6f2e951ba84e65928.tar.gz |
Merge remote-tracking branch 'mikeperry/209-path-bias-changes'
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index 2103087ee..696a41197 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -693,6 +693,26 @@ connection_ap_process_end_not_open( edge_connection_t *edge_conn = ENTRY_TO_EDGE_CONN(conn); (void) layer_hint; /* unused */ + if (rh->length > 0) { + if (reason == END_STREAM_REASON_TORPROTOCOL || + reason == END_STREAM_REASON_INTERNAL || + reason == END_STREAM_REASON_DESTROY) { + /* All three of these reasons could mean a failed tag + * hit the exit and it complained. Do not probe. + * Fail the circuit. */ + circ->path_state = PATH_STATE_USE_FAILED; + return -END_CIRC_REASON_TORPROTOCOL; + } else { + /* Path bias: If we get a valid reason code from the exit, + * it wasn't due to tagging. + * + * We rely on recognized+digest being strong enough to make + * tags unlikely to allow us to get tagged, yet 'recognized' + * reason codes here. */ + circ->path_state = PATH_STATE_USE_SUCCEEDED; + } + } + if (rh->length > 0 && edge_reason_is_retriable(reason) && /* avoid retry if rend */ !connection_edge_is_rendezvous_stream(edge_conn)) { |