diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2009-08-19 15:41:12 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2009-08-19 15:41:12 +0200 |
commit | 4e29f3342754fa8802c364b58f7b2f98e983a291 (patch) | |
tree | f570d879362bf688ab1da6290689d1d099656df1 /src/or/config.c | |
parent | 10fbc998e146b271508066e7680cb0cd00a70c63 (diff) | |
download | tor-4e29f3342754fa8802c364b58f7b2f98e983a291.tar.gz tor-4e29f3342754fa8802c364b58f7b2f98e983a291.zip |
Write all statistics to disk exactly every 24 hours.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/src/or/config.c b/src/or/config.c index 7b3f0ad07f..acc544b8b8 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1407,29 +1407,13 @@ options_act(or_options_t *old_options) tor_free(actual_fname); } - if (options->DirReqStatistics) { + if (options->DirReqStatistics && !geoip_is_loaded()) { /* Check if GeoIP database could be loaded. */ - if (!geoip_is_loaded()) { - log_warn(LD_CONFIG, "Configured to measure directory request " - "statistics, but no GeoIP database found!"); - return -1; - } - log_notice(LD_CONFIG, "Configured to count directory requests by " - "country and write aggregate statistics to disk. Check the " - "dirreq-stats file in your data directory that will first " - "be written in 24 hours from now."); + log_warn(LD_CONFIG, "Configured to measure directory request " + "statistics, but no GeoIP database found!"); + return -1; } - if (options->ExitPortStatistics) - log_notice(LD_CONFIG, "Configured to measure exit port statistics. " - "Look for the exit-stats file that will first be written to " - "the data directory in 24 hours from now."); - - if (options->CellStatistics) - log_notice(LD_CONFIG, "Configured to measure cell statistics. Look " - "for the buffer-stats file that will first be written to " - "the data directory in 24 hours from now."); - if (options->EntryStatistics) { if (should_record_bridge_info(options)) { /* Don't allow measuring statistics on entry guards when configured @@ -1442,11 +1426,7 @@ options_act(or_options_t *old_options) log_warn(LD_CONFIG, "Configured to measure entry node statistics, " "but no GeoIP database found!"); return -1; - } else - log_notice(LD_CONFIG, "Configured to measure entry node " - "statistics. Look for the entry-stats file that will " - "first be written to the data directory in 24 hours " - "from now."); + } } /* Check if we need to parse and add the EntryNodes config option. */ @@ -3784,6 +3764,16 @@ options_transition_allowed(or_options_t *old, or_options_t *new_val, return -1; } + if (old->CellStatistics != new_val->CellStatistics || + old->DirReqStatistics != new_val->DirReqStatistics || + old->EntryStatistics != new_val->EntryStatistics || + old->ExitPortStatistics != new_val->ExitPortStatistics) { + *msg = tor_strdup("While Tor is running, changing either " + "CellStatistics, DirReqStatistics, EntryStatistics, " + "or ExitPortStatistics is not allowed."); + return -1; + } + return 0; } |