diff options
author | Mike Perry <mikeperry-git@fscked.org> | 2009-09-18 02:01:39 -0700 |
---|---|---|
committer | Mike Perry <mikeperry-git@fscked.org> | 2009-09-20 14:51:30 -0700 |
commit | f39bedf250ce878436acda2b7217fa0b5621ffaa (patch) | |
tree | 476172fdbb2ca038d6eb147a41d07c5b50947473 /src/or/circuituse.c | |
parent | 6700e528be5ee688439730f7e8f13b3ce9b64e09 (diff) | |
download | tor-f39bedf250ce878436acda2b7217fa0b5621ffaa.tar.gz tor-f39bedf250ce878436acda2b7217fa0b5621ffaa.zip |
Implement and document new network liveness algorithm.
Based on irc discussion with arma.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index f95f25407f..95159c3b1a 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -362,8 +362,13 @@ circuit_expire_building(time_t now) circuit_log_path(LOG_INFO,LD_CIRC,TO_ORIGIN_CIRCUIT(victim)); circuit_mark_for_close(victim, END_CIRC_REASON_TIMEOUT); - circuit_build_times_add_timeout(&circ_times); - circuit_build_times_set_timeout(&circ_times); + + if (circuit_build_times_add_timeout(&circ_times, + TO_ORIGIN_CIRCUIT(circ)->cpath + && TO_ORIGIN_CIRCUIT(circ)->cpath->state == CPATH_STATE_OPEN, + circ->timestamp_created)) { + circuit_build_times_set_timeout(&circ_times); + } } } @@ -838,6 +843,9 @@ circuit_build_failed(origin_circuit_t *circ) "(%s:%d). I'm going to try to rotate to a better connection.", n_conn->_base.address, n_conn->_base.port); n_conn->is_bad_for_new_circs = 1; + } else { + log_info(LD_OR, + "Our circuit died before the first hop with no connection"); } if (n_conn_id) { entry_guard_register_connect_status(n_conn_id, 0, 1, time(NULL)); |