From d7b04a87886c9926b799e263f95b947a237e04cb Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 7 Oct 2005 22:00:09 +0000 Subject: [PATCH] do not try to download a routerdesc if we would immediately reject it as obsolete. svn:r5225 --- src/or/routerlist.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 8678324a4a..e6fbce424c 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2544,7 +2544,8 @@ router_list_downloadable(void) time_t now = time(NULL); int mirror = server_mode(get_options()) && get_options()->DirPort; /* these are just used for logging */ - int n_not_ready = 0, n_in_progress = 0, n_uptodate = 0, n_skip_old = 0; + int n_not_ready = 0, n_in_progress = 0, n_uptodate = 0, n_skip_old = 0, + n_obsolete = 0; if (!routerstatus_list) return superseded; @@ -2555,7 +2556,10 @@ router_list_downloadable(void) SMARTLIST_FOREACH(routerstatus_list, local_routerstatus_t *, rs, { - if (rs->next_attempt_at < now) { + if (rs->status.published_on + ROUTER_MAX_AGE < now) { + rs->should_download = 0; + ++n_obsolete; + } if (rs->next_attempt_at < now) { rs->should_download = 1; ++n_downloadable; } else { @@ -2654,8 +2658,10 @@ router_list_downloadable(void) log_fn(LOG_INFO, "%d router descriptors are downloadable; " "%d are up to date; %d are in progress; " "%d are not ready to retry; " + "%d are not published recently enough to be worthwhile; " "%d are running pre-0.1.1.6 Tors and aren't stale enough to replace.", - n_downloadable, n_uptodate, n_in_progress, n_not_ready, n_skip_old); + n_downloadable, n_uptodate, n_in_progress, n_not_ready, + n_obsolete, n_skip_old); if (!n_downloadable) return superseded;