From c0b6cb132baaf9cf259bfb09e14c1128d7abc9d6 Mon Sep 17 00:00:00 2001 From: Karsten Loesing Date: Sun, 5 Jul 2009 20:48:16 +0200 Subject: If configured, write entry-node statistics to disk periodically. --- src/or/config.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/or/config.c') diff --git a/src/or/config.c b/src/or/config.c index f1fea13e5..c9ef21bb8 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -198,6 +198,7 @@ static config_var_t _option_vars[] = { V(DownloadExtraInfo, BOOL, "0"), V(EnforceDistinctSubnets, BOOL, "1"), V(EntryNodes, ROUTERSET, NULL), + V(EntryStatistics, BOOL, "0"), V(TestingEstimatedDescriptorPropagationTime, INTERVAL, "10 minutes"), V(ExcludeNodes, ROUTERSET, NULL), V(ExcludeExitNodes, ROUTERSET, NULL), @@ -1394,6 +1395,25 @@ options_act(or_options_t *old_options) if (options->ExitPortStatistics) log_warn(LD_CONFIG, "ExitPortStatistics enabled, but Tor was built " "without port statistics support."); +#endif +#ifdef ENABLE_ENTRY_STATS + if (options->EntryStatistics) { + if (should_record_bridge_info(options)) { + /* Don't allow measuring statistics on entry guards when configured + * as bridge. */ + log_warn(LD_CONFIG, "Bridges cannot be configured to measure " + "additional GeoIP statistics as entry guards."); + 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."); + } +#else + if (options->EntryStatistics) + log_warn(LD_CONFIG, "EntryStatistics enabled, but Tor was built " + "without entry node statistics support."); #endif /* Check if we need to parse and add the EntryNodes config option. */ if (options->EntryNodes && -- cgit v1.2.3