summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-05-22 01:55:48 +0000
committerNick Mathewson <nickm@torproject.org>2007-05-22 01:55:48 +0000
commit8cf3fd98ec4155b955cbd72b9d2709be9dbd37f6 (patch)
tree04d8d373fbd4cc59ed9e0c76f5a9e7ca3989ccfc /src/or/routerlist.c
parent1837b5670ffdce778df0d97d3b0a922a6d2aec63 (diff)
downloadtor-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
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c5
1 files changed, 3 insertions, 2 deletions
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);