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

[or-cvs] r13077: don't rebuild the router store for all those times when we f (tor/trunk/src/or)



Author: arma
Date: 2008-01-08 18:31:25 -0500 (Tue, 08 Jan 2008)
New Revision: 13077

Modified:
   tor/trunk/src/or/routerlist.c
Log:
don't rebuild the router store for all those times when we
fetch one descriptor and then we don't like it


Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2008-01-08 23:08:39 UTC (rev 13076)
+++ tor/trunk/src/or/routerlist.c	2008-01-08 23:31:25 UTC (rev 13077)
@@ -3155,6 +3155,7 @@
   const char *msg;
   int from_cache = (saved_location != SAVED_NOWHERE);
   int allow_annotations = (saved_location != SAVED_NOWHERE);
+  int any_changed = 0;
 
   router_parse_list_from_string(&s, eos, routers, saved_location, 0,
                                 allow_annotations, prepend_annotations);
@@ -3186,6 +3187,7 @@
     }
 
     if (router_add_to_routerlist(ri, &msg, from_cache, !from_cache) >= 0) {
+      any_changed = 1;
       smartlist_add(changed, ri);
       routerlist_descriptors_added(changed, from_cache);
       smartlist_clear(changed);
@@ -3194,7 +3196,8 @@
 
   routerlist_assert_ok(routerlist);
 
-  router_rebuild_store(0, &routerlist->desc_store);
+  if (any_changed)
+    router_rebuild_store(0, &routerlist->desc_store);
 
   smartlist_free(routers);
   smartlist_free(changed);