diff options
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index e8bb977bbf..888ab9cafc 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -869,9 +869,9 @@ 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); } - connection_read_bucket_decrement(conn, result); return 0; } @@ -1001,10 +1001,9 @@ int connection_handle_write(connection_t *conn) { if(result > 0 && !is_local_IP(conn->addr)) { /* remember it */ rep_hist_note_bytes_written(result, now); + global_write_bucket -= result; } - global_write_bucket -= result; - if(!connection_wants_to_flush(conn)) { /* it's done flushing */ if(connection_finished_flushing(conn) < 0) { /* already marked */ |