]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't do expensive consensus stuff when not a cache.
authorNick Mathewson <nickm@torproject.org>
Wed, 23 Aug 2017 14:22:51 +0000 (10:22 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 23 Aug 2017 14:22:51 +0000 (10:22 -0400)
This includes generating and storing compressed consensuses, and
consensus diffs.  Fixes bug 23275; bugfix on 0.3.1.1-alpha.

changes/bug23275 [new file with mode: 0644]
src/or/main.c
src/or/networkstatus.c

diff --git a/changes/bug23275 b/changes/bug23275
new file mode 100644 (file)
index 0000000..d6c3c47
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (relay):
+    - When a relay is not running as a directory cache, it will no longer
+      generate compressed consensuses and consensus diff information.
+      Previously, this was a waste of disk and CPU.  Fixes bug 23275;
+      bugfix on 0.3.1.1-alpha.
index cb24fd18c807cfbb7f97e66d5ef76381fe2a464b..7b1f4975f7438762834512cbbe86bcd61d63cda3 100644 (file)
@@ -1487,7 +1487,7 @@ run_scheduled_events(time_t now)
 
   /* 12. launch diff computations.  (This is free if there are none to
    * launch.) */
-  if (server_mode(options)) {
+  if (dir_server_mode(options)) {
     consdiffmgr_rescan();
   }
 }
index 25d79139b97e131faee28ee98de323e39b3d83fc..997280de5273294a305e9f04e2349f964dc42657 100644 (file)
@@ -2014,7 +2014,7 @@ networkstatus_set_current_consensus(const char *consensus,
                                                &c->digests,
                                                c->digest_sha3_as_signed,
                                                c->valid_after);
-    if (server_mode(get_options())) {
+    if (dir_server_mode(get_options())) {
       consdiffmgr_add_consensus(consensus, c);
     }
   }