summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-14 22:21:23 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-14 22:21:23 +0000
commit3e6edf20cca98c01d73285ac1ce1f61f4e3e6d99 (patch)
treef59bf38b4e3846c942bd53c12c044e75b719a212 /src/or/main.c
parent402c75fb0616d03e006aed2504b24a266685a4a4 (diff)
downloadtor-3e6edf20cca98c01d73285ac1ce1f61f4e3e6d99.tar.gz
tor-3e6edf20cca98c01d73285ac1ce1f61f4e3e6d99.zip
Resolve some hibernating-related XXXX009s.
svn:r2875
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/or/main.c b/src/or/main.c
index cf6533db11..eeb97630fb 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -737,6 +737,8 @@ static int do_hup(void) {
log_fn(LOG_NOTICE,"Received sighup. Reloading config.");
has_completed_circuit=0;
+ accounting_record_bandwidth_usage();
+
/* first, reload config variables, in case they've changed */
/* no need to provide argc/v, they've been cached inside init_from_config */
if (init_from_config(0, NULL) < 0) {
@@ -793,11 +795,6 @@ static int do_main_loop(void) {
stats_prev_global_read_bucket = global_read_bucket;
stats_prev_global_write_bucket = global_write_bucket;
- /*XXX009 move to options_act? */
- /* Set up accounting */
- if (get_options()->AccountingMaxKB)
- configure_accounting(time(NULL));
-
/* load the routers file, or assign the defaults. */
if(router_reload_router_list()) {
return -1;
@@ -1082,6 +1079,7 @@ void tor_cleanup(void) {
if(options->PidFile && options->command == CMD_RUN_TOR)
unlink(options->PidFile);
crypto_global_cleanup();
+ accounting_record_bandwidth_usage();
}
/** Read/create keys as needed, and echo our fingerprint to stdout. */