Browse Source

Merge remote-tracking branch 'karsten/task-5824'

Nick Mathewson 10 years ago
parent
commit
043329eeb6
4 changed files with 17 additions and 4 deletions
  1. 4 0
      changes/bug5824
  2. 4 0
      changes/bug5824-2
  3. 6 2
      src/or/config.c
  4. 3 2
      src/or/geoip.c

+ 4 - 0
changes/bug5824

@@ -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.
+

+ 4 - 0
changes/bug5824-2

@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Bridges now report complete directory request statistics. Related to
+      bug 5824; bugfix on 0.2.2.1-alpha.
+

+ 6 - 2
src/or/config.c

@@ -1660,10 +1660,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;
     }

+ 3 - 2
src/or/geoip.c

@@ -556,8 +556,9 @@ geoip_note_client_seen(geoip_client_action_t action,
         (!(options->BridgeRelay && options->BridgeRecordUsageByCountry)))
       return;
   } else {
-    if (options->BridgeRelay || options->BridgeAuthoritativeDir ||
-        !options->DirReqStatistics)
+    /* Only gather directory-request statistics if configured, and
+     * forcibly disable them on bridge authorities. */
+    if (!options->DirReqStatistics || options->BridgeAuthoritativeDir)
       return;
   }