diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-11-15 04:48:53 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-11-15 04:48:53 +0000 |
commit | c909a8a64bd0db432012f96b1c04fcbcc632693a (patch) | |
tree | fac2a48030a56e73a159b6af57b0d1bc5683017b /src | |
parent | 930464c88931efa5f98f279343994f96639f69b5 (diff) | |
download | tor-c909a8a64bd0db432012f96b1c04fcbcc632693a.tar tor-c909a8a64bd0db432012f96b1c04fcbcc632693a.tar.gz |
Only record bandwidth usage when accounting is enabled
svn:r2886
Diffstat (limited to 'src')
-rw-r--r-- | src/or/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c index 81e32fe70..ab3849c73 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -737,7 +737,8 @@ static int do_hup(void) { log_fn(LOG_NOTICE,"Received sighup. Reloading config."); has_completed_circuit=0; - accounting_record_bandwidth_usage(time(NULL)); + if (accounting_is_enabled(options)) + accounting_record_bandwidth_usage(time(NULL)); /* first, reload config variables, in case they've changed */ /* no need to provide argc/v, they've been cached inside init_from_config */ @@ -1079,7 +1080,8 @@ void tor_cleanup(void) { if(options->PidFile && options->command == CMD_RUN_TOR) unlink(options->PidFile); crypto_global_cleanup(); - accounting_record_bandwidth_usage(time(NULL)); + if (accounting_is_enabled(options)) + accounting_record_bandwidth_usage(time(NULL)); } /** Read/create keys as needed, and echo our fingerprint to stdout. */ |