mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Correctly report written bytes on linked connections.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
o Minor bugfixes:
|
||||
- Correctly report written bytes on linked connections. Found while
|
||||
implementing 1790. Bugfix on 0.2.2.4-alpha.
|
||||
|
||||
+6
-2
@@ -2409,8 +2409,12 @@ loop_again:
|
||||
connection_t *linked = conn->linked_conn;
|
||||
|
||||
if (n_read) {
|
||||
/* Probably a no-op, but hey. */
|
||||
connection_buckets_decrement(linked, approx_time(), n_read, 0);
|
||||
/* Probably a no-op, since linked conns typically don't count for
|
||||
* bandwidth rate limiting. But do it anyway so we can keep stats
|
||||
* accurately. Note that since we read the bytes from conn, and
|
||||
* we're writing the bytes onto the linked connection, we count
|
||||
* these as <i>written</i> bytes. */
|
||||
connection_buckets_decrement(linked, approx_time(), 0, n_read);
|
||||
|
||||
if (connection_flushed_some(linked) < 0)
|
||||
connection_mark_for_close(linked);
|
||||
|
||||
Reference in New Issue
Block a user