diff options
author | Peter Palfrader <peter@palfrader.org> | 2005-12-23 23:56:42 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2005-12-23 23:56:42 +0000 |
commit | 4bd65f0f98b8f1d1a0aea7c7f20bc4978647f531 (patch) | |
tree | 3abb9a405eeb527534b570d9044bd246e2778b98 /src/or/main.c | |
parent | f7e82babcb450fb5c9d9aea6c7b6b897318cbaf1 (diff) | |
download | tor-4bd65f0f98b8f1d1a0aea7c7f20bc4978647f531.tar tor-4bd65f0f98b8f1d1a0aea7c7f20bc4978647f531.tar.gz |
Keep bandwidth history accross restarts/crashes
svn:r5637
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c index f5353c805..4c9b808f6 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -779,6 +779,9 @@ run_scheduled_events(time_t now) * and the rend cache. */ rep_history_clean(now - options->RephistTrackTime); rend_cache_clean(); + /* And while we are at it, save the state with bandwidth history + * and more. */ + or_state_save(); } /* Caches need to fetch running_routers; directory clients don't. */ @@ -1494,6 +1497,7 @@ tor_cleanup(void) unlink(options->PidFile); if (accounting_is_enabled(options)) accounting_record_bandwidth_usage(time(NULL)); + or_state_save(); tor_free_all(0); /* move tor_free_all back into the ifdef below later. XXX*/ crypto_global_cleanup(); #ifdef USE_DMALLOC |