mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
r13148@catbus: nickm | 2007-06-02 10:24:20 -0400
Fix bug 441, 442, and possibly 417 (again). svn:r10449
This commit is contained in:
+6
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user