]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't log about stats when running as a client without geoip
authorSebastian Hahn <sebastian@torproject.org>
Fri, 18 Nov 2011 23:50:03 +0000 (00:50 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Fri, 18 Nov 2011 23:50:03 +0000 (00:50 +0100)
Completely disable stats if we aren't running as a relay. We won't
collect any anyway, so setting up the infrastructure for them and
logging about them is wrong. This also removes a confusing log
message that clients without a geoip db would have seen.

Fixes bug 4353.

changes/bug4353 [new file with mode: 0644]
src/or/config.c

diff --git a/changes/bug4353 b/changes/bug4353
new file mode 100644 (file)
index 0000000..5e80c90
--- /dev/null
@@ -0,0 +1,7 @@
+  o Minor bugfixes:
+    - When running as client without a geoip database, do not print a
+      misleading (and plain wrong) log message that we're collecting
+      dirreq statistics - we're not collecting statistics as clients.
+      Also don't create a useless (because empty) stats file in the
+      stats/ directory. Fixes bug 4353, bugfix on 0.2.2.34.
+
index ca4e71cccd513b6367451fd911886fc745a2f021..ffa763e65c7bdb8752bfe6a14e60ce301f1e2d53 100644 (file)
@@ -1414,6 +1414,15 @@ options_act(or_options_t *old_options)
       options->EntryStatistics || options->ExitPortStatistics) {
     time_t now = time(NULL);
     int print_notice = 0;
+
+    /* If we aren't acting as a server, we can't collect stats anyway. */
+    if (!server_mode(options)) {
+      options->CellStatistics = 0;
+      options->DirReqStatistics = 0;
+      options->EntryStatistics = 0;
+      options->ExitPortStatistics = 0;
+    }
+
     if ((!old_options || !old_options->CellStatistics) &&
         options->CellStatistics) {
       rep_hist_buffer_stats_init(now);