mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
connection_read_bucket_decrement() has a side-effect that
we need to get even if we just read 0 bytes svn:r2656
This commit is contained in:
@@ -882,9 +882,15 @@ static int connection_read_to_buf(connection_t *conn) {
|
||||
|
||||
if(result > 0 && !is_local_IP(conn->addr)) { /* remember it */
|
||||
rep_hist_note_bytes_read(result, time(NULL));
|
||||
connection_read_bucket_decrement(conn, result);
|
||||
}
|
||||
|
||||
/* Call even if result is 0, since the global read bucket may
|
||||
* have reached 0 on a different conn, and this guy needs to
|
||||
* know to stop reading. */
|
||||
/* Longer-term, we should separate this out to read_bucket_decrement
|
||||
* and consider_empty_buckets, and just call the second one always. */
|
||||
connection_read_bucket_decrement(conn, result);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user