diff options
author | Mike Perry <mikeperry-git@fscked.org> | 2009-10-07 12:49:13 -0700 |
---|---|---|
committer | Mike Perry <mikeperry-git@fscked.org> | 2009-10-07 12:49:13 -0700 |
commit | ec05e64a68bf788a9cf7e448cef8bdf065fe505e (patch) | |
tree | 903c53e7e31c0d1550e3b2cc5f7be9fe594cdb6c /src/or/circuitbuild.c | |
parent | b918cd8f04c255af37b1eae7434577579f44f9bc (diff) | |
download | tor-ec05e64a68bf788a9cf7e448cef8bdf065fe505e.tar tor-ec05e64a68bf788a9cf7e448cef8bdf065fe505e.tar.gz |
Tweak values for when to discard all of our history.
This seems to be happening to me a lot on a garbage DSL line.
We may need to come up with 2 threshholds: a high short onehop
count and a lower longer count.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 46b1b3ca7..0ff7f272f 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -753,10 +753,8 @@ circuit_build_times_network_timeout(circuit_build_times_t *cbt, if (cbt->liveness.network_last_live <= start_time && start_time <= (now - cbt->timeout_ms/1000.0)) { cbt->liveness.nonlive_timeouts++; - } - - /* Check for one-hop timeout */ - if (did_onehop) { + } else if (did_onehop) { + /* Count a one-hop timeout */ cbt->liveness.timeouts_after_firsthop[cbt->liveness.after_firsthop_idx]=1; cbt->liveness.after_firsthop_idx++; cbt->liveness.after_firsthop_idx %= RECENT_CIRCUITS; @@ -823,7 +821,7 @@ circuit_build_times_network_check_changed(circuit_build_times_t *cbt) timeout_count += cbt->liveness.timeouts_after_firsthop[i]; } - /* If 75% of our recent circuits are timing out after the first hop, + /* If 80% of our recent circuits are timing out after the first hop, * we need to re-estimate a new initial alpha and timeout. */ if (timeout_count < MAX_RECENT_TIMEOUT_COUNT) { return 0; |