summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-01-05 06:59:36 +0000
committerRoger Dingledine <arma@torproject.org>2007-01-05 06:59:36 +0000
commit48a9fe4bbd82b30cacffa7211db4dd76ac398c21 (patch)
tree246d504f2878a66e767d404fd81031fbff5a9feb /src/or/connection.c
parentee0d2d486d0a43ce03f96e841c42b426e304d461 (diff)
downloadtor-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.c5
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 */