]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a check for when to rebuild the microdesc cache. (Backport from 0.2.3.
authorNick Mathewson <nickm@torproject.org>
Tue, 3 May 2011 20:29:39 +0000 (16:29 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 3 May 2011 20:29:39 +0000 (16:29 -0400)
changes/bug2230_part2 [new file with mode: 0644]
src/or/microdesc.c

diff --git a/changes/bug2230_part2 b/changes/bug2230_part2
new file mode 100644 (file)
index 0000000..2664ecc
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes
+    - The microdesc journal is supposed to get rebuilt only if it is
+      at least _half_ the length of the store, not _twice_ the length
+      of the store.   Bugfix on 0.2.2.6-alpha; fixes part of bug 2230.
+
index 356627700d2f811f67d57edacb24546b95748051..0ceb134a610e1ae8807b6ea4667e0111aa63d8e0 100644 (file)
@@ -208,7 +208,7 @@ microdescs_add_list_to_cache(microdesc_cache_t *cache,
     size_t old_content_len =
       cache->cache_content ? cache->cache_content->size : 0;
     if (cache->journal_len > 16384 + old_content_len &&
-        cache->journal_len > old_content_len * 2) {
+        cache->journal_len > old_content_len / 2) {
       microdesc_cache_rebuild(cache);
     }
   }