[or-cvs] r11995: Add a debugging info msg to routerlist (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Tue Oct 16 18:47:32 UTC 2007


Author: nickm
Date: 2007-10-16 14:47:32 -0400 (Tue, 16 Oct 2007)
New Revision: 11995

Modified:
   tor/trunk/
   tor/trunk/src/or/routerlist.c
Log:
 r15871 at catbus:  nickm | 2007-10-16 14:47:00 -0400
 Add a debugging info msg to routerlist



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r15871] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-10-16 18:19:02 UTC (rev 11994)
+++ tor/trunk/src/or/routerlist.c	2007-10-16 18:47:32 UTC (rev 11995)
@@ -3720,6 +3720,8 @@
   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 @@
   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);



More information about the tor-commits mailing list