[or-cvs] [tor/master] Tweak values for when to discard all of our history.
arma at seul.org
arma at seul.org
Wed Oct 7 20:11:27 UTC 2009
Author: Mike Perry <mikeperry-git at fscked.org>
Date: Wed, 7 Oct 2009 12:49:13 -0700
Subject: Tweak values for when to discard all of our history.
Commit: ec05e64a68bf788a9cf7e448cef8bdf065fe505e
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.
---
src/or/circuitbuild.c | 8 +++-----
src/or/or.h | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 46b1b3c..0ff7f27 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;
diff --git a/src/or/or.h b/src/or/or.h
index 0162e31..b11cc82 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2927,7 +2927,7 @@ typedef uint32_t build_time_t;
* This tells us to abandon timeout history and set
* the timeout back to BUILD_TIMEOUT_INITIAL_VALUE.
*/
-#define MAX_RECENT_TIMEOUT_COUNT (lround(RECENT_CIRCUITS*0.75))
+#define MAX_RECENT_TIMEOUT_COUNT (lround(RECENT_CIRCUITS*0.8))
/** Information about the state of our local network connection */
typedef struct {
--
1.5.6.5
More information about the tor-commits
mailing list