diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-10-07 22:00:09 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-10-07 22:00:09 +0000 |
commit | d7b04a87886c9926b799e263f95b947a237e04cb (patch) | |
tree | 0bb1288d7c61eb3e0d860f8990db6d81db40320d | |
parent | 2572db2472812c6b48f1fde16cc5d7866135f799 (diff) | |
download | tor-d7b04a87886c9926b799e263f95b947a237e04cb.tar tor-d7b04a87886c9926b799e263f95b947a237e04cb.tar.gz |
do not try to download a routerdesc if we would immediately reject it as obsolete.
svn:r5225
-rw-r--r-- | src/or/routerlist.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 8678324a4..e6fbce424 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; |