[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10449: Fix bug 441, 442, and possibly 417 (again). (in tor/trunk: . src/or)



Author: nickm
Date: 2007-06-02 10:24:23 -0400 (Sat, 02 Jun 2007)
New Revision: 10449

Modified:
   tor/trunk/
   tor/trunk/src/or/routerlist.c
Log:
 r13148@catbus:  nickm | 2007-06-02 10:24:20 -0400
 Fix bug 441, 442, and possibly 417 (again).



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13148] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-06-02 13:46:48 UTC (rev 10448)
+++ tor/trunk/src/or/routerlist.c	2007-06-02 14:24:23 UTC (rev 10449)
@@ -2140,9 +2140,10 @@
   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 @@
         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 @@
     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);
   }