diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-10-16 18:47:32 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-10-16 18:47:32 +0000 |
commit | c23409080e958b1ba37c45f45c6f680f748e2e88 (patch) | |
tree | 7f3d84e0b86dc67ba51463a8b23bfd36f549e929 /src/or/routerlist.c | |
parent | 9d7eba6ecc0760922c3c4e8cc06407ad79d855ae (diff) | |
download | tor-c23409080e958b1ba37c45f45c6f680f748e2e88.tar tor-c23409080e958b1ba37c45f45c6f680f748e2e88.tar.gz |
r15871@catbus: nickm | 2007-10-16 14:47:00 -0400
Add a debugging info msg to routerlist
svn:r11995
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index dc47cc17d..684e61800 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -3720,6 +3720,8 @@ update_consensus_router_descriptor_downloads(time_t now) int authdir = authdir_mode(options); int dirserver = dirserver_mode(options); networkstatus_vote_t *consensus = networkstatus_get_live_consensus(now); + int n_delayed=0, n_have=0, n_would_reject=0, n_wouldnt_use=0, + n_inprogress=0; if (!dirserver) { if (rep_hist_circbuilding_dormant(now)) @@ -3732,21 +3734,37 @@ update_consensus_router_descriptor_downloads(time_t now) list_pending_descriptor_downloads(map, 0); SMARTLIST_FOREACH(consensus->routerstatus_list, routerstatus_t *, rs, { - if (router_get_by_descriptor_digest(rs->descriptor_digest)) + if (router_get_by_descriptor_digest(rs->descriptor_digest)) { + ++n_have; continue; /* We have it already. */ + } if (!download_status_is_ready(&rs->dl_status, now, - MAX_ROUTERDESC_DOWNLOAD_FAILURES)) + MAX_ROUTERDESC_DOWNLOAD_FAILURES)) { + ++n_delayed; continue; + } - if (authdir && dirserv_would_reject_router(rs)) + if (authdir && dirserv_would_reject_router(rs)) { + ++n_would_reject; continue; /* We would throw it out immediately. */ - if (!dirserver && !client_would_use_router(rs, now, options)) + } + if (!dirserver && !client_would_use_router(rs, now, options)) { + ++n_wouldnt_use; continue; /* We would never use it ourself. */ - if (digestmap_get(map, rs->descriptor_digest)) + } + if (digestmap_get(map, rs->descriptor_digest)) { + ++n_inprogress; continue; /* We have an in-progress download. */ + } smartlist_add(downloadable, rs->descriptor_digest); }); + log_info(LD_DIR, + "%d routers downloadable. %d delayed; %d present; %d would_reject; " + "%d wouldnt_use, %d in progress.", + smartlist_len(downloadable), n_delayed, n_have, n_would_reject, + n_wouldnt_use, n_inprogress); + launch_router_descriptor_downloads(downloadable, now); smartlist_free(downloadable); |