diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2009-06-24 19:51:45 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-07-02 12:37:05 -0400 |
commit | 4d6af73db88e409764f43fc6cdaa432d667becf3 (patch) | |
tree | de8f80573fc939975f8e6e8bb0d6becf39621045 /src/or/connection.c | |
parent | 078c34e28e02bcb3a9fd28f3fee3c5e956ec8e1f (diff) | |
download | tor-4d6af73db88e409764f43fc6cdaa432d667becf3.tar.gz tor-4d6af73db88e409764f43fc6cdaa432d667becf3.zip |
If configured, write per-port exit statistics to disk periodically.
[Original patch series from Karsten, revised and squashed by Nick]
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index c8406fee3f..0897eb4a5e 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1702,10 +1702,16 @@ connection_buckets_decrement(connection_t *conn, time_t now, tor_fragile_assert(); } - if (num_read > 0) + if (num_read > 0) { + if (conn->type == CONN_TYPE_EXIT) + rep_hist_note_exit_bytes_read(conn->port, num_read, now); rep_hist_note_bytes_read(num_read, now); - if (num_written > 0) + } + if (num_written > 0) { + if (conn->type == CONN_TYPE_EXIT) + rep_hist_note_exit_bytes_written(conn->port, num_written, now); rep_hist_note_bytes_written(num_written, now); + } if (connection_counts_as_relayed_traffic(conn, now)) { global_relayed_read_bucket -= (int)num_read; |