aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2009-06-20 05:25:14 -0400
committerNick Mathewson <nickm@torproject.org>2009-06-30 10:10:13 -0400
commite7bc189f7c8fb4c2a490f10bd26d81893626ade1 (patch)
tree7216c347961397ba116e59d6a17c6a13107eb189 /src/or/main.c
parentbdca5476daa900813fcc3ad04b3e952dcaddc994 (diff)
downloadtor-e7bc189f7c8fb4c2a490f10bd26d81893626ade1.tar
tor-e7bc189f7c8fb4c2a490f10bd26d81893626ade1.tar.gz
the third piece of bug 969 fixing
when we write out our stability info, detect relays that have slipped through the cracks. log about them and correct the problem. if we continue to see a lot of these over time, it means there's another spot where relays fall out of the routerlist without being marked as unreachable.
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 8fc712bba..60c42aaae 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -903,7 +903,7 @@ run_scheduled_events(time_t now)
time_to_downrate_stability = rep_hist_downrate_old_runs(now);
if (authdir_mode_tests_reachability(options)) {
if (time_to_save_stability < now) {
- if (time_to_save_stability && rep_hist_record_mtbf_data()<0) {
+ if (time_to_save_stability && rep_hist_record_mtbf_data(now, 1)<0) {
log_warn(LD_GENERAL, "Couldn't store mtbf data.");
}
#define SAVE_STABILITY_INTERVAL (30*60)
@@ -1955,14 +1955,15 @@ tor_cleanup(void)
/* Remove our pid file. We don't care if there was an error when we
* unlink, nothing we could do about it anyways. */
if (options->command == CMD_RUN_TOR) {
+ time_t now = time(NULL);
if (options->PidFile)
unlink(options->PidFile);
if (accounting_is_enabled(options))
- accounting_record_bandwidth_usage(time(NULL), get_or_state());
+ accounting_record_bandwidth_usage(now, get_or_state());
or_state_mark_dirty(get_or_state(), 0); /* force an immediate save. */
- or_state_save(time(NULL));
+ or_state_save(now);
if (authdir_mode_tests_reachability(options))
- rep_hist_record_mtbf_data();
+ rep_hist_record_mtbf_data(now, 0);
}
#ifdef USE_DMALLOC
dmalloc_log_stats();