From 4a74812c70b75df8938de00c9efb0fabaf699300 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 14 Feb 2007 16:46:49 +0000 Subject: r11812@catbus: nickm | 2007-02-14 11:22:08 -0500 Apply stream_bw patch from Robert Hogan. svn:r9585 --- src/or/connection.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/or/connection.c') diff --git a/src/or/connection.c b/src/or/connection.c index a8853ef48..7d31e3f95 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1571,6 +1571,13 @@ connection_read_to_buf(connection_t *conn, int *max_to_read) *max_to_read = at_most - n_read; } + if (CONN_IS_EDGE(conn)) { + if (conn->type == CONN_TYPE_AP) { + edge_connection_t *edge_conn = TO_EDGE_CONN(conn); + edge_conn->n_read += n_read; + } + } + if (connection_is_rate_limited(conn)) { /* For non-local IPs, remember if we flushed any bytes over the wire. */ time_t now = time(NULL); @@ -1767,6 +1774,13 @@ connection_handle_write(connection_t *conn, int force) n_written = (size_t) result; } + if (CONN_IS_EDGE(conn)) { + if (conn->type == CONN_TYPE_AP) { + edge_connection_t *edge_conn = TO_EDGE_CONN(conn); + edge_conn->n_written += n_written; + } + } + if (connection_is_rate_limited(conn)) { /* For non-local IPs, remember if we flushed any bytes over the wire. */ time_t now = time(NULL); -- cgit v1.2.3