[or-cvs] Only record bandwidth usage when accounting is enabled
Nick Mathewson
nickm at seul.org
Mon Nov 15 04:48:56 UTC 2004
Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv15861/src/or
Modified Files:
main.c
Log Message:
Only record bandwidth usage when accounting is enabled
Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.376
retrieving revision 1.377
diff -u -d -r1.376 -r1.377
--- main.c 15 Nov 2004 04:01:31 -0000 1.376
+++ main.c 15 Nov 2004 04:48:53 -0000 1.377
@@ -737,7 +737,8 @@
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 @@
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. */
More information about the tor-commits
mailing list