From bda4ca065c1b6c39e68b0793538c5e5c15890d44 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 7 Nov 2008 14:57:14 +0000 Subject: [PATCH] Aaaaand, do not reset the download count just because we have a certificate that is listed in a consensus. svn:r17212 --- src/or/routerlist.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 8e1af408ad..3c73c8079f 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -111,6 +111,7 @@ get_cert_list(const char *id_digest) cl = digestmap_get(trusted_dir_certs, id_digest); if (!cl) { cl = tor_malloc_zero(sizeof(cert_list_t)); + cl->dl_status.schedule = DL_SCHED_CONSENSUS; cl->certs = smartlist_create(); digestmap_set(trusted_dir_certs, id_digest, cl); } @@ -406,6 +407,7 @@ void authority_certs_fetch_missing(networkstatus_t *status, time_t now) { digestmap_t *pending; + authority_cert_t *cert; smartlist_t *missing_digests; char *resource = NULL; cert_list_t *cl; @@ -428,8 +430,9 @@ authority_certs_fetch_missing(networkstatus_t *status, time_t now) !trusteddirserver_get_by_v3_auth_digest(voter->identity_digest)) continue; /* We are not a cache, and we don't know this authority.*/ cl = get_cert_list(voter->identity_digest); - if (authority_cert_get_by_digests(voter->identity_digest, - voter->signing_key_digest)) { + cert = authority_cert_get_by_digests(voter->identity_digest, + voter->signing_key_digest); + if (cert && now < cert->expires) { download_status_reset(&cl->dl_status); continue; }