summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-01-16 20:52:30 +0000
committerNick Mathewson <nickm@torproject.org>2006-01-16 20:52:30 +0000
commit1057516a076c9a61ad96246ea6cff524e003c3aa (patch)
tree69a88570b6607fe94579a35e567183857097f389 /src
parentf0d4b3d18f167c6dd4af6d8eeccf951a6cc1def6 (diff)
downloadtor-1057516a076c9a61ad96246ea6cff524e003c3aa.tar.gz
tor-1057516a076c9a61ad96246ea6cff524e003c3aa.zip
Clients should not download descriptors for non-running descriptors.
svn:r5830
Diffstat (limited to 'src')
-rw-r--r--src/or/routerlist.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 27d9ab8669..387df36fae 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3252,7 +3252,7 @@ router_list_client_downloadable(void)
time_t now = time(NULL);
/* these are just used for logging */
int n_not_ready = 0, n_in_progress = 0, n_uptodate = 0,
- n_obsolete = 0, n_too_young = 0;
+ n_obsolete = 0, n_too_young = 0, n_wouldnt_use = 0;
if (!routerstatus_list)
return downloadable;
@@ -3270,6 +3270,9 @@ router_list_client_downloadable(void)
} else if (digestmap_get(downloading, rs->status.descriptor_digest)) {
/* We're downloading this one now. */
++n_in_progress;
+ } else if (!rs->status.is_running) {
+ /* If we had this router descriptor, we wouldn't even bother using it. */
+ ++n_wouldnt_use;
} else if (router_get_by_descriptor_digest(rs->status.descriptor_digest)) {
/* We have the 'best' descriptor for this router. */
++n_uptodate;
@@ -3293,11 +3296,11 @@ router_list_client_downloadable(void)
#if 0
info(LD_DIR,
- "%d routers are downloadable. %d are too old to consider. "
+ "%d router descriptors are downloadable. %d are too old to consider. "
"%d are in progress. %d are up-to-date. %d are too young to consider. "
- "%d failed too recently to retry.",
+ "%d are non-useful. %d failed too recently to retry.",
n_downloadable, n_obsolete, n_in_progress, n_uptodate, n_too_young,
- n_not_ready);
+ n_wouldnt_use, n_not_ready);
#endif
digestmap_free(downloading, NULL);