diff options
author | Mike Perry <mikeperry-git@fscked.org> | 2012-12-07 17:47:23 -0800 |
---|---|---|
committer | Mike Perry <mikeperry-git@fscked.org> | 2012-12-07 17:47:23 -0800 |
commit | 26fa47226cab49b260ba764aa050880f71927ea0 (patch) | |
tree | 5426fb2a5842c185b5864e5458171f422a67dd89 /src/or/connection_edge.c | |
parent | c3b71a3fc96c6f3eaaebd96ef8c15d4298d9639e (diff) | |
download | tor-26fa47226cab49b260ba764aa050880f71927ea0.tar.gz tor-26fa47226cab49b260ba764aa050880f71927ea0.zip |
Refactor path use bias code into own function.
Also, improve and log some failure cases.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 31ff90093c..79bb54cbb7 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -2181,10 +2181,14 @@ connection_ap_handshake_socks_reply(entry_connection_t *conn, char *reply, if (status == SOCKS5_SUCCEEDED) { if(!conn->edge_.on_circuit || !CIRCUIT_IS_ORIGIN(conn->edge_.on_circuit)) { - // XXX: Weird. We hit this a lot, and yet have no unusable_circs - log_warn(LD_BUG, "No origin circuit for successful SOCKS stream"); + // XXX: Weird. We hit this a lot, and yet have no unusable_circs. + // Maybe during addrmaps/resolves? + log_warn(LD_BUG, + "(Harmless.) No origin circuit for successful SOCKS stream. " + "Reason: %d", endreason); } else { - TO_ORIGIN_CIRCUIT(conn->edge_.on_circuit)->any_streams_succeeded = 1; + TO_ORIGIN_CIRCUIT(conn->edge_.on_circuit)->path_state + = PATH_STATE_USE_SUCCEEDED; } } @@ -2457,7 +2461,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) connection_exit_connect(n_stream); /* For path bias: This circuit was used successfully */ - origin_circ->any_streams_succeeded = 1; + origin_circ->path_state = PATH_STATE_USE_SUCCEEDED; tor_free(address); return 0; |