diff options
author | Roger Dingledine <arma@torproject.org> | 2007-01-05 06:59:36 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-01-05 06:59:36 +0000 |
commit | 48a9fe4bbd82b30cacffa7211db4dd76ac398c21 (patch) | |
tree | 246d504f2878a66e767d404fd81031fbff5a9feb /src/or/connection.c | |
parent | ee0d2d486d0a43ce03f96e841c42b426e304d461 (diff) | |
download | tor-48a9fe4bbd82b30cacffa7211db4dd76ac398c21.tar.gz tor-48a9fe4bbd82b30cacffa7211db4dd76ac398c21.zip |
be a bit less eager to reject v1 dir requests due to load
svn:r9271
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 1a8195d398..f42182ba6f 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1182,7 +1182,10 @@ global_write_bucket_low(size_t attempt, int priority) return 1; /* not enough space no matter the priority */ if (priority == 1) { /* old-style v1 query */ - if (global_write_bucket-attempt < 2*get_options()->BandwidthRate) + /* Could we handle *two* of these requests within the next two seconds? */ + /* XXX012 make this robust against overflows */ + if (global_write_bucket + 2*(int)(get_options()->BandwidthRate) < + 2*(int)attempt) return 1; } else { /* v2 query */ /* no further constraints yet */ |