]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
stats: Make PaddingStatistics depend on ExtraInfoStatistics
authorteor <teor@torproject.org>
Tue, 8 Jan 2019 08:21:10 +0000 (18:21 +1000)
committerteor <teor@torproject.org>
Tue, 8 Jan 2019 08:21:10 +0000 (18:21 +1000)
When ExtraInfoStatistics is 0, stop including PaddingStatistics in
relay and bridge extra-info documents.

Fixes bug 29017; bugfix on 0.3.1.1-alpha.

changes/bug29017 [new file with mode: 0644]
doc/tor.1.txt
src/or/router.c

diff --git a/changes/bug29017 b/changes/bug29017
new file mode 100644 (file)
index 0000000..5c4a53c
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (stats):
+    - When ExtraInfoStatistics is 0, stop including PaddingStatistics in
+      relay and bridge extra-info documents. Fixes bug 29017;
+      bugfix on 0.3.1.1-alpha.
index c089bffbb0475a1cf2f3696bb3f1519d9636db4c..790ac6f6ae89143b094352f9d7e9143401dbbf06 100644 (file)
@@ -2266,7 +2266,7 @@ is non-zero):
     extra-info document. (Default: 0)
 
 [[PaddingStatistics]] **PaddingStatistics** **0**|**1**::
-    Relays only.
+    Relays and bridges only.
     When this option is enabled, Tor collects statistics for padding cells
     sent and received by this relay, in addition to total cell counts.
     These statistics are rounded, and omitted if traffic is low. This
index edaa040dd7da28e565faa380d67b64b8f4069dcd..c308bcfae1984ff0aa0f9620ca5af4543cedec46 100644 (file)
@@ -3304,12 +3304,11 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo,
                         "conn-bi-direct", now, &contents) > 0) {
       smartlist_add(chunks, contents);
     }
-  }
-
-  if (options->PaddingStatistics) {
-    contents = rep_hist_get_padding_count_lines();
-    if (contents)
-      smartlist_add(chunks, contents);
+    if (options->PaddingStatistics) {
+      contents = rep_hist_get_padding_count_lines();
+      if (contents)
+        smartlist_add(chunks, contents);
+    }
   }
 
   /* Add information about the pluggable transports we support. */