diff options
author | Mike Perry <mikeperry-git@fscked.org> | 2012-11-17 16:30:50 -0800 |
---|---|---|
committer | Mike Perry <mikeperry-git@fscked.org> | 2012-12-07 15:28:38 -0800 |
commit | 412ae099cb656ab47fc8cbb408aa5f4cee956961 (patch) | |
tree | 61414cce9a93269793c435b2c716bb25f12313ad /src/or/connection_edge.c | |
parent | da5c398d79c890966339558749662fa8ffabf480 (diff) | |
download | tor-412ae099cb656ab47fc8cbb408aa5f4cee956961.tar.gz tor-412ae099cb656ab47fc8cbb408aa5f4cee956961.zip |
Prop 209: Add path bias counts for timeouts and other mechanisms.
Turns out there's more than one way to block a tagged circuit.
This seems to successfully handle all of the normal exit circuits. Hidden
services need additional tweaks, still.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 95088c7c17..cb2afe1e86 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -2176,6 +2176,17 @@ connection_ap_handshake_socks_reply(entry_connection_t *conn, char *reply, status==SOCKS5_SUCCEEDED ? STREAM_EVENT_SUCCEEDED : STREAM_EVENT_FAILED, endreason); + /* Flag this stream's circuit as having completed a stream successfully + * (for path bias) */ + if (status == SOCKS5_SUCCEEDED) { + if(!conn->edge_.on_circuit || + !CIRCUIT_IS_ORIGIN(conn->edge_.on_circuit)) { + log_warn(LD_BUG, "No origin circuit for successful SOCKS stream"); + } else { + TO_ORIGIN_CIRCUIT(conn->edge_.on_circuit)->any_streams_succeeded = 1; + } + } + if (conn->socks_request->has_finished) { log_warn(LD_BUG, "(Harmless.) duplicate calls to " "connection_ap_handshake_socks_reply."); |