diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-05-22 01:55:48 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-05-22 01:55:48 +0000 |
commit | 8cf3fd98ec4155b955cbd72b9d2709be9dbd37f6 (patch) | |
tree | 04d8d373fbd4cc59ed9e0c76f5a9e7ca3989ccfc | |
parent | 1837b5670ffdce778df0d97d3b0a922a6d2aec63 (diff) | |
download | tor-8cf3fd98ec4155b955cbd72b9d2709be9dbd37f6.tar.gz tor-8cf3fd98ec4155b955cbd72b9d2709be9dbd37f6.zip |
r12847@catbus: nickm | 2007-05-21 21:55:47 -0400
Backport r12842: Make stores get rebuild at the proper time, and note dropped bytes better.
svn:r10246
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/or/routerlist.c | 5 |
2 files changed, 6 insertions, 2 deletions
@@ -26,6 +26,9 @@ Changes in version 0.1.2.14 - 2007-0?-?? having a hard time downloading. - Read resolv.conf files correctly on platforms where read() returns partial results on small file reads. + - Don't rebuild the entire router store every time we get 32K of + routers: rebuild it when the journal gets very large, or when + the gaps in the store get very large. o Minor features: - When routers publish SVN revisions in their router descriptors, diff --git a/src/or/routerlist.c b/src/or/routerlist.c index f02feb76a7..3fa0f5efb6 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -241,7 +241,6 @@ _compare_routers_by_age(const void **_a, const void **_b) static int router_rebuild_store(int force) { - size_t len = 0; or_options_t *options; size_t fname_len; smartlist_t *chunk_list = NULL; @@ -337,7 +336,8 @@ router_rebuild_store(int force) write_str_to_file(fname, "", 1); r = 0; - router_store_len = len; + tor_assert(offset >= 0); + router_store_len = (size_t) offset; router_journal_len = 0; router_bytes_dropped = 0; done: @@ -1715,6 +1715,7 @@ routerlist_replace(routerlist_t *rl, routerinfo_t *ri_old, digestmap_remove(rl->desc_digest_map, ri_old->cache_info.signed_descriptor_digest); } + router_bytes_dropped += ri_old->cache_info.signed_descriptor_len; routerinfo_free(ri_old); } // routerlist_assert_ok(rl); |