]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Disable (Cell,Entry,ExitPort)Statistics on bridges
authorKarsten Loesing <karsten.loesing@gmx.net>
Wed, 18 Dec 2013 17:00:17 +0000 (18:00 +0100)
committerKarsten Loesing <karsten.loesing@gmx.net>
Wed, 18 Dec 2013 17:01:25 +0000 (18:01 +0100)
In 0.2.3.8-alpha we attempted to "completely disable stats if we aren't
running as a relay", but instead disabled them only if we aren't running
as a server.

This commit leaves DirReqStatistics enabled on both relays and bridges,
and disables (Cell,Entry,ExitPort)Statistics on bridges.

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

diff --git a/changes/bug5824 b/changes/bug5824
new file mode 100644 (file)
index 0000000..15d366f
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Bridges now never collect statistics that were designed for relays.
+      Fix for bug 5824; bugfix on 0.2.3.8-alpha.
+
index d348f1036bdb7647938c4a771fa68da3facf6280..379685802c0f41d7b497f57e06c5ae03ddaa7e82 100644 (file)
@@ -1684,10 +1684,14 @@ options_act(const or_options_t *old_options)
     time_t now = time(NULL);
     int print_notice = 0;
 
-    /* If we aren't acting as a server, we can't collect stats anyway. */
+    /* Only collect directory-request statistics on relays and bridges. */
     if (!server_mode(options)) {
-      options->CellStatistics = 0;
       options->DirReqStatistics = 0;
+    }
+
+    /* Only collect other relay-only statistics on relays. */
+    if (!public_server_mode(options)) {
+      options->CellStatistics = 0;
       options->EntryStatistics = 0;
       options->ExitPortStatistics = 0;
     }