summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-07-07 14:26:50 -0400
committerNick Mathewson <nickm@torproject.org>2009-07-07 14:26:50 -0400
commit041a7b989630c846fa087628145920198da001f6 (patch)
treeed29c7fcd22f79a5192c6f136ca6ecb1b9bc2548 /src/or/config.c
parent1c1b22391061613f875d88daf2f54d083ff929ec (diff)
parentc0b6cb132baaf9cf259bfb09e14c1128d7abc9d6 (diff)
downloadtor-041a7b989630c846fa087628145920198da001f6.tar.gz
tor-041a7b989630c846fa087628145920198da001f6.zip
Merge commit 'karsten/entrystats-master'
Conflicts: ChangeLog configure.in src/or/config.c src/or/or.h
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index f7a5745262..5137f74792 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -199,6 +199,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),
@@ -1396,6 +1397,7 @@ options_act(or_options_t *old_options)
log_warn(LD_CONFIG, "ExitPortStatistics enabled, but Tor was built "
"without port statistics support.");
#endif
+
#ifdef ENABLE_BUFFER_STATS
if (options->CellStatistics)
log_notice(LD_CONFIG, "Configured to measure cell statistics. Look "
@@ -1406,6 +1408,26 @@ options_act(or_options_t *old_options)
log_warn(LD_CONFIG, "CellStatistics enabled, but Tor was built "
"without cell 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 &&
(!old_options ||