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

[or-cvs] Make insert_old try hard to never add a duplicate.



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv4357/src/or

Modified Files:
	routerlist.c 
Log Message:
Make insert_old try hard to never add a duplicate.

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.404
retrieving revision 1.405
diff -u -p -d -r1.404 -r1.405
--- routerlist.c	27 Dec 2005 05:26:03 -0000	1.404
+++ routerlist.c	27 Dec 2005 05:58:12 -0000	1.405
@@ -1226,7 +1226,9 @@ routerlist_insert(routerlist_t *rl, rout
 static void
 routerlist_insert_old(routerlist_t *rl, routerinfo_t *ri)
 {
-  if (get_options()->DirPort) {
+  if (get_options()->DirPort &&
+      !digestmap_get(rl->desc_digest_map,
+                     ri->cache_info.signed_descriptor_digest)) {
     signed_descriptor_t *sd = signed_descriptor_from_routerinfo(ri);
     digestmap_set(rl->desc_digest_map, sd->signed_descriptor_digest, sd);
     smartlist_add(rl->old_routers, sd);