diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-06-02 14:24:23 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-06-02 14:24:23 +0000 |
commit | 8400cecb1dc805b0f81582feb237b9d77347bfb8 (patch) | |
tree | a16ed424818dfeb3c19d6ce964e1e42381dc169d | |
parent | 57cdf4ee46f9ea4c52de5b6080558e72e6e180b0 (diff) | |
download | tor-8400cecb1dc805b0f81582feb237b9d77347bfb8.tar.gz tor-8400cecb1dc805b0f81582feb237b9d77347bfb8.zip |
r13148@catbus: nickm | 2007-06-02 10:24:20 -0400
Fix bug 441, 442, and possibly 417 (again).
svn:r10449
-rw-r--r-- | src/or/routerlist.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 6e5c8b7d6d..ab4775a636 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2140,9 +2140,10 @@ routerlist_replace(routerlist_t *rl, routerinfo_t *ri_old, digestmap_set(rl->desc_digest_map, ri_new->cache_info.signed_descriptor_digest, &(ri_new->cache_info)); - if (!tor_digest_is_zero(ri_new->cache_info.signed_descriptor_digest)) + if (!tor_digest_is_zero(ri_new->cache_info.extra_info_digest)) { digestmap_set(rl->desc_by_eid_map, ri_new->cache_info.extra_info_digest, ri_new); + } if (make_old && get_options()->DirPort && ri_old->purpose == ROUTER_PURPOSE_GENERAL) { @@ -2167,9 +2168,10 @@ routerlist_replace(routerlist_t *rl, routerinfo_t *ri_old, ei_tmp->cache_info.signed_descriptor_len; extrainfo_free(ei_tmp); } - if (!tor_digest_is_zero(ri_old->cache_info.extra_info_digest)) + if (!tor_digest_is_zero(ri_old->cache_info.extra_info_digest)) { digestmap_remove(rl->desc_by_eid_map, ri_old->cache_info.extra_info_digest); + } router_store_stats.bytes_dropped += ri_old->cache_info.signed_descriptor_len; routerinfo_free(ri_old); @@ -5181,6 +5183,8 @@ routerlist_assert_ok(routerlist_t *rl) signed_descriptor_t *sd; digestmap_iter_get(iter, &d, &_sd); sd = _sd; + tor_assert(!tor_digest_is_zero(d)); + tor_assert(sd); tor_assert(!memcmp(sd->extra_info_digest, d, DIGEST_LEN)); iter = digestmap_iter_next(rl->desc_by_eid_map, iter); } |