mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
r16464@catbus: nickm | 2007-11-06 14:53:28 -0500
Also avoid overflow on or_conn->read_bucket svn:r12401
This commit is contained in:
parent
be1a5191f8
commit
47fd6f7267
@ -1699,9 +1699,11 @@ connection_bucket_refill(int seconds_elapsed, time_t now)
|
||||
if (connection_speaks_cells(conn)) {
|
||||
or_connection_t *or_conn = TO_OR_CONN(conn);
|
||||
if (connection_read_bucket_should_increase(or_conn)) {
|
||||
or_conn->read_bucket += or_conn->bandwidthrate*seconds_elapsed;
|
||||
if (or_conn->read_bucket > or_conn->bandwidthburst)
|
||||
or_conn->read_bucket = or_conn->bandwidthburst;
|
||||
connection_bucket_refill_helper(&or_conn->read_bucket,
|
||||
or_conn->bandwidthrate,
|
||||
or_conn->bandwidthburst,
|
||||
seconds_elapsed,
|
||||
"or_conn->read_bucket");
|
||||
//log_fn(LOG_DEBUG,"Receiver bucket %d now %d.", i,
|
||||
// conn->read_bucket);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user