[or-cvs] [tor/master] parameterize update_consensus_router_descriptor_downloads

arma at torproject.org arma at torproject.org
Mon Apr 19 09:02:37 UTC 2010


Author: Roger Dingledine <arma at torproject.org>
Date: Tue, 16 Mar 2010 04:36:14 -0400
Subject: parameterize update_consensus_router_descriptor_downloads
Commit: c9573cf50b84b4c7cc5af42a924eef12d9752747

---
 src/or/routerlist.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 13123e4..6c97bd0 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -27,7 +27,8 @@ static int router_nickname_matches(routerinfo_t *router, const char *nickname);
 static void trusted_dir_server_free(trusted_dir_server_t *ds);
 static void launch_router_descriptor_downloads(smartlist_t *downloadable,
                                                time_t now);
-static void update_consensus_router_descriptor_downloads(time_t now);
+static void update_consensus_router_descriptor_downloads(time_t now,
+                                                  networkstatus_t *consensus);
 static int signed_desc_digest_is_recognized(signed_descriptor_t *desc);
 static void update_router_have_minimum_dir_info(void);
 static const char *signed_descriptor_get_body_impl(signed_descriptor_t *desc,
@@ -4328,18 +4329,17 @@ update_router_descriptor_cache_downloads_v2(time_t now)
   digestmap_free(map,NULL);
 }
 
-/** For any descriptor that we want that's currently listed in the live
- * consensus, download it as appropriate. */
+/** For any descriptor that we want that's currently listed in
+ * <b>consensus</b>, download it as appropriate. */
 static void
-update_consensus_router_descriptor_downloads(time_t now)
+update_consensus_router_descriptor_downloads(time_t now,
+                                             networkstatus_t *consensus)
 {
   or_options_t *options = get_options();
   digestmap_t *map = NULL;
   smartlist_t *no_longer_old = smartlist_create();
   smartlist_t *downloadable = smartlist_create();
   int authdir = authdir_mode(options);
-  networkstatus_t *consensus =
-    networkstatus_get_reasonably_live_consensus(now);
   int n_delayed=0, n_have=0, n_would_reject=0, n_wouldnt_use=0,
     n_inprogress=0, n_in_oldrouters=0;
 
@@ -4444,7 +4444,8 @@ update_router_descriptor_downloads(time_t now)
   if (directory_fetches_dir_info_early(options)) {
     update_router_descriptor_cache_downloads_v2(now);
   }
-  update_consensus_router_descriptor_downloads(now);
+  update_consensus_router_descriptor_downloads(now,
+    networkstatus_get_reasonably_live_consensus(now));
 
   /* XXXX021 we could be smarter here; see notes on bug 652. */
   /* If we're a server that doesn't have a configured address, we rely on
-- 
1.6.5



More information about the tor-commits mailing list