aboutsummaryrefslogtreecommitdiff
path: root/src/or/microdesc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/microdesc.c')
-rw-r--r--src/or/microdesc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index 469c2fcadb..521ee07091 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -246,9 +246,10 @@ 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))
+ if (cache->journal_len > 16384 + old_content_len &&
+ cache->journal_len > old_content_len / 2) {
microdesc_cache_rebuild(cache);
+ }
}
{
@@ -305,6 +306,7 @@ microdesc_cache_reload(microdesc_cache_t *cache)
journal_content = read_file_to_str(cache->journal_fname,
RFTS_IGNORE_MISSING, &st);
if (journal_content) {
+ cache->journal_len = (size_t) st.st_size;
added = microdescs_add_to_cache(cache, journal_content,
journal_content+st.st_size,
SAVED_IN_JOURNAL, 0, -1, NULL);