diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-07-16 15:26:07 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-07-16 15:26:07 -0400 |
commit | 022d251cb7c979a37c01e87fa20c83fb5e986830 (patch) | |
tree | c040aa6d039c8832e2b9c72d77c1d3ab29041a91 /src/or/config.c | |
parent | 82795eebb75e2c60b9a294a27100c3f19021dde5 (diff) | |
parent | cbe432739183ad9cb307f15362489bcc86b405d0 (diff) | |
download | tor-022d251cb7c979a37c01e87fa20c83fb5e986830.tar.gz tor-022d251cb7c979a37c01e87fa20c83fb5e986830.zip |
Merge branch 'dirreq-timing'
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/src/or/config.c b/src/or/config.c index 940a205748..1ec666ad9a 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -187,12 +187,13 @@ static config_var_t _option_vars[] = { V(DirPort, UINT, "0"), V(DirPortFrontPage, FILENAME, NULL), OBSOLETE("DirPostPeriod"), -#ifdef ENABLE_GEOIP_STATS +#ifdef ENABLE_DIRREQ_STATS OBSOLETE("DirRecordUsageByCountry"), OBSOLETE("DirRecordUsageGranularity"), OBSOLETE("DirRecordUsageRetainIPs"), OBSOLETE("DirRecordUsageSaveInterval"), #endif + V(DirReqStatistics, BOOL, "0"), VAR("DirServer", LINELIST, DirServers, NULL), V(DNSPort, UINT, "0"), V(DNSListenAddress, LINELIST, NULL), @@ -1376,17 +1377,25 @@ options_act(or_options_t *old_options) geoip_load_file(actual_fname, options); tor_free(actual_fname); } -#ifdef ENABLE_GEOIP_STATS - /* Check if GeoIP database could be loaded. */ - if (!geoip_is_loaded()) { - log_warn(LD_CONFIG, "Configured to measure GeoIP statistics, but no " - "GeoIP database found!"); - return -1; + +#ifdef ENABLE_DIRREQ_STATS + if (options->DirReqStatistics) { + /* 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_notice(LD_CONFIG, "Configured to measure usage by country and " - "write aggregate statistics to disk. Check the geoip-stats file " - "in your data directory once I've been running for 24 hours."); +#else + log_warn(LD_CONFIG, "DirReqStatistics enabled, but Tor was built " + "without support for directory request statistics."); #endif + #ifdef ENABLE_EXIT_STATS if (options->ExitPortStatistics) log_notice(LD_CONFIG, "Configured to measure exit port statistics. " @@ -1417,6 +1426,11 @@ options_act(or_options_t *old_options) log_warn(LD_CONFIG, "Bridges cannot be configured to measure " "additional GeoIP statistics as entry guards."); return -1; + } else if (!geoip_is_loaded()) { + /* Check if GeoIP database could be loaded. */ + 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 " |