]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
When not fetching v2 dir info, don't require it for cleaning descriptors
authorDaniel Bryg <daniel@accessnow.org>
Thu, 23 Feb 2012 18:57:27 +0000 (13:57 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 23 Feb 2012 18:59:37 +0000 (13:59 -0500)
Bugfix on 0.2.2.26-beta, which introduced the idea of caches not
cacheing v2 info.  Fixes bug 4838.

changes/bug4838 [new file with mode: 0644]
src/or/routerlist.c

diff --git a/changes/bug4838 b/changes/bug4838
new file mode 100644 (file)
index 0000000..8c92bdb
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bufixes:
+    - Directory caches no longer refuse to clean out descriptors when
+      because of missing v2 networkstatus documents, unless they're
+      actually trying to retrieve v2 networkstatus documents.  Bugfix
+      on 0.2.2.26-beta; fixes bug 4838. Patch by Daniel Bryg.
index 2524fc9870b4c3a36548563efbcf28c33827353d..d0ef662ca86a119639188d3c86a5b03902da1b3c 100644 (file)
@@ -3614,6 +3614,7 @@ routerlist_remove_old_routers(void)
   const networkstatus_t *consensus = networkstatus_get_latest_consensus();
   const smartlist_t *networkstatus_v2_list = networkstatus_get_v2_list();
   int have_enough_v2;
+  const or_options_t *options = get_options();
 
   trusted_dirs_remove_old_certs();
 
@@ -3675,6 +3676,7 @@ routerlist_remove_old_routers(void)
    * routers.) */
   /* we set this to true iff we don't care about v2 info, or we have enough. */
   have_enough_v2 = !caches ||
+    !(authdir_mode_any_main(options) || options->FetchV2Networkstatus) ||
     (networkstatus_v2_list &&
      smartlist_len(networkstatus_v2_list) > get_n_v2_authorities() / 2);