[tor-commits] [tor/master] Correct moribund logic about caching v2 networkstatuses

nickm at torproject.org nickm at torproject.org
Thu Dec 13 17:44:27 UTC 2012


commit 404e3dd48149434a22c6b27bc253afd78ce5a9bf
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Sep 7 23:01:53 2012 -0400

    Correct moribund logic about caching v2 networkstatuses
---
 src/or/dirserv.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 8be436d..b4cb0c9 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1478,7 +1478,6 @@ dirserv_set_cached_networkstatus_v2(const char *networkstatus,
                                     time_t published)
 {
   cached_dir_t *d, *old_d;
-  const smartlist_t *trusted_dirs;
   if (!cached_v2_networkstatus)
     cached_v2_networkstatus = digestmap_new();
 
@@ -1501,9 +1500,9 @@ dirserv_set_cached_networkstatus_v2(const char *networkstatus,
   }
 
   /* Now purge old entries. */
-  trusted_dirs = router_get_trusted_dir_servers();
+
   if (digestmap_size(cached_v2_networkstatus) >
-      smartlist_len(trusted_dirs) + MAX_UNTRUSTED_NETWORKSTATUSES) {
+      get_n_authorities(V2_DIRINFO) + MAX_UNTRUSTED_NETWORKSTATUSES) {
     /* We need to remove the oldest untrusted networkstatus. */
     const char *oldest = NULL;
     time_t oldest_published = TIME_MAX;





More information about the tor-commits mailing list