aboutsummaryrefslogtreecommitdiff
path: root/src/or/microdesc.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-12 11:19:52 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-12 11:19:52 -0400
commitbdff7e3299d78cd2f7aa4a31e5f57c1aeef5ffa1 (patch)
tree8524d0f9a976f9dfccbaba8e48359ddc178c3e33 /src/or/microdesc.c
parentb47f574c1e27b8665e9e2658409645a3831e7aa4 (diff)
downloadtor-bdff7e3299d78cd2f7aa4a31e5f57c1aeef5ffa1.tar.gz
tor-bdff7e3299d78cd2f7aa4a31e5f57c1aeef5ffa1.zip
Unmap microdesc cache before replacing it.
If we do a replace-then-munmap, windows will never actually rewrite the microdesc cache. Found by wanoskarnet; bugfix on 0.2.2.6-alpha.
Diffstat (limited to 'src/or/microdesc.c')
-rw-r--r--src/or/microdesc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index 5740c40d5f..1554aca918 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -399,10 +399,11 @@ microdesc_cache_rebuild(microdesc_cache_t *cache, int force)
smartlist_add(wrote, md);
}
- finish_writing_to_file(open_file); /*XXX Check me.*/
-
if (cache->cache_content)
tor_munmap_file(cache->cache_content);
+
+ finish_writing_to_file(open_file); /*XXX Check me.*/
+
cache->cache_content = tor_mmap_file(cache->cache_fname);
if (!cache->cache_content && smartlist_len(wrote)) {