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 | |
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')
-rw-r--r-- | src/or/connection.c | 5 | ||||
-rw-r--r-- | src/or/directory.c | 4 |
2 files changed, 4 insertions, 5 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 */ diff --git a/src/or/directory.c b/src/or/directory.c index 7e80af6363..c4a06f448a 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1610,10 +1610,6 @@ directory_handle_command_get(dir_connection_t *conn, char *headers, return 0; } - /* FFFF for status/ and server/ requests, we don't have a good - * guess of the length we're going to be writing out, so it's hard - * to call global_write_bucket_low(). How to proceed? */ - if (!strcmpstart(url,"/tor/status/")) { /* v2 network status fetch. */ size_t url_len = strlen(url); |