aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2010-08-09 15:25:09 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2010-08-18 13:54:41 +0200
commit58b6195455bcb173d260558e84e642c52d344c2f (patch)
treed06fd4a9a852ec4cee1a90c6103adc9223077426 /src/or/connection.c
parentdb94b7f46ef02d5a1de132a5b746b350f3d066b7 (diff)
downloadtor-58b6195455bcb173d260558e84e642c52d344c2f.tar
tor-58b6195455bcb173d260558e84e642c52d344c2f.tar.gz
Correctly report written bytes on linked connections.
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 5438cf7d0..99ce7fffe 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -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);