diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2011-11-19 00:50:03 +0100 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2011-11-19 00:50:03 +0100 |
commit | 6ef44b78495403552ca4f6808656bd95a7813c58 (patch) | |
tree | 067ba942df9ccd3b6db78790653d1607a28b25f7 /src/or | |
parent | 5a02406ae0d8059d3b0bbff51d37fcb92650274b (diff) | |
download | tor-6ef44b78495403552ca4f6808656bd95a7813c58.tar.gz tor-6ef44b78495403552ca4f6808656bd95a7813c58.zip |
Don't log about stats when running as a client without geoip
Completely disable stats if we aren't running as a relay. We won't
collect any anyway, so setting up the infrastructure for them and
logging about them is wrong. This also removes a confusing log
message that clients without a geoip db would have seen.
Fixes bug 4353.
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/config.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index ca4e71cccd..ffa763e65c 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1414,6 +1414,15 @@ options_act(or_options_t *old_options) options->EntryStatistics || options->ExitPortStatistics) { time_t now = time(NULL); int print_notice = 0; + + /* If we aren't acting as a server, we can't collect stats anyway. */ + if (!server_mode(options)) { + options->CellStatistics = 0; + options->DirReqStatistics = 0; + options->EntryStatistics = 0; + options->ExitPortStatistics = 0; + } + if ((!old_options || !old_options->CellStatistics) && options->CellStatistics) { rep_hist_buffer_stats_init(now); |