summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2010-08-11 14:13:08 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2010-08-11 16:19:54 +0200
commitacd25558b825f5d1254738fc45f5c7f0ccb3fb94 (patch)
treec3da824f4215d8affb30936549f26efd6c2a8f26 /src/or/connection.c
parent863b6c439e6bfc64f602ecb9526940fa966ca9fe (diff)
downloadtor-acd25558b825f5d1254738fc45f5c7f0ccb3fb94.tar.gz
tor-acd25558b825f5d1254738fc45f5c7f0ccb3fb94.zip
Refactor exit port statistics code and add unit tests.
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 55d2fa8146..0eb05b74ab 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2096,15 +2096,13 @@ connection_buckets_decrement(connection_t *conn, time_t now,
}
if (num_read > 0) {
- if (conn->type == CONN_TYPE_EXIT)
- rep_hist_note_exit_bytes_read(conn->port, num_read);
rep_hist_note_bytes_read(num_read, now);
}
if (num_written > 0) {
- if (conn->type == CONN_TYPE_EXIT)
- rep_hist_note_exit_bytes_written(conn->port, num_written);
rep_hist_note_bytes_written(num_written, now);
}
+ if (conn->type == CONN_TYPE_EXIT)
+ rep_hist_note_exit_bytes(conn->port, num_written, num_read);
if (connection_counts_as_relayed_traffic(conn, now)) {
global_relayed_read_bucket -= (int)num_read;