diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-12-13 12:42:29 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-12-13 12:42:29 -0500 |
commit | 01ac961ca1fc46efeec141ea275c6ea9971c3ee7 (patch) | |
tree | 35f6176135d9bb52900ca0a285619b1fc407e110 /src/or/dirserv.c | |
parent | 21b5d76aa57bec3f585634be84884ac8fbb2a10f (diff) | |
parent | f742b33d85c0884fa5902d0d24a1232c9bd47dd8 (diff) | |
download | tor-01ac961ca1fc46efeec141ea275c6ea9971c3ee7.tar tor-01ac961ca1fc46efeec141ea275c6ea9971c3ee7.tar.gz |
Merge branch 'fallback_dirsource_v3'
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index b35b71010..0eb1fb3c6 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1471,7 +1471,6 @@ dirserv_set_cached_networkstatus_v2(const char *networkstatus, time_t published) { cached_dir_t *d, *old_d; - smartlist_t *trusted_dirs; if (!cached_v2_networkstatus) cached_v2_networkstatus = digestmap_new(); @@ -1494,9 +1493,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; @@ -3127,7 +3126,7 @@ dirserv_get_networkstatus_v2_fingerprints(smartlist_t *result, } } else { SMARTLIST_FOREACH(router_get_trusted_dir_servers(), - trusted_dir_server_t *, ds, + dir_server_t *, ds, if (ds->type & V2_DIRINFO) smartlist_add(result, tor_memdup(ds->digest, DIGEST_LEN))); } |