mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-19 18:00:33 +01:00
be a bit less eager to reject v1 dir requests due to load
svn:r9271
This commit is contained in:
parent
ee0d2d486d
commit
48a9fe4bbd
@ -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 */
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user