mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
47df912f1c
Now that we update our buckets on demand before reading or writing, we no longer need to update them all every TokenBucketRefillInterval msec. When a connection runs out of bandwidth, we do need a way to reenable it, however. We do this by scheduling a timer to reenable all blocked connections for TokenBucketRefillInterval msec after a connection becomes blocked. (If we were using PerConnBWRate more, it might make sense to have a per-connection timer, rather than a single timeout. But since PerConnBWRate is currently (mostly) unused, I'm going to go for the simpler approach here, since usually whenever one connection has become blocked on bandwidth, most connections are blocked on bandwidth.) Implements ticket 25373.
8 lines
425 B
Plaintext
8 lines
425 B
Plaintext
o Major features (main loop, CPU wakeup):
|
|
- The bandwidth-limitation logic has been refactored so that
|
|
bandwidth calculations are performed on-demand, rather than
|
|
every TokenBucketRefillInterval milliseconds.
|
|
This change should improve the granularity of our bandwidth
|
|
calculations, and limit the number of times that the Tor process needs
|
|
to wake up when it is idle. Closes ticket 25373.
|