[tor-commits] [tor/master] Better messages when we're stalled because of microdescriptors

nickm at torproject.org nickm at torproject.org
Fri Jul 15 23:37:27 UTC 2011


commit 975150a13ec3500b233e2d60d547bca7b89d895d
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Jul 15 19:38:27 2011 -0400

    Better messages when we're stalled because of microdescriptors
    
    It's a little confusing for me to say "only X/Y descriptors" when
    I have microdescriptors enabled.  So, let's fix that.
---
 src/or/routerlist.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 2fff4c9..8b09813 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -4967,6 +4967,7 @@ update_router_have_minimum_dir_info(void)
   const or_options_t *options = get_options();
   const networkstatus_t *consensus =
     networkstatus_get_reasonably_live_consensus(now,usable_consensus_flavor());
+  int using_md;
 
   if (!consensus) {
     if (!networkstatus_get_latest_consensus())
@@ -4987,19 +4988,22 @@ update_router_have_minimum_dir_info(void)
     goto done;
   }
 
+  using_md = consensus->flavor == FLAV_MICRODESC;
+
   count_usable_descriptors(&num_present, &num_usable, consensus, options, now,
                            NULL);
 
   if (num_present < num_usable/4) {
     tor_snprintf(dir_info_status, sizeof(dir_info_status),
-            "We have only %d/%d usable descriptors.", num_present, num_usable);
+                 "We have only %d/%d usable %sdescriptors.",
+                 num_present, num_usable, using_md ? "micro" : "");
     res = 0;
     control_event_bootstrap(BOOTSTRAP_STATUS_REQUESTING_DESCRIPTORS, 0);
     goto done;
   } else if (num_present < 2) {
     tor_snprintf(dir_info_status, sizeof(dir_info_status),
-                 "Only %d descriptor%s here and believed reachable!",
-                 num_present, num_present ? "" : "s");
+                 "Only %d %sdescriptor%s here and believed reachable!",
+                 num_present, using_md ? "micro" : "", num_present ? "" : "s");
     res = 0;
     goto done;
   }
@@ -5011,8 +5015,8 @@ update_router_have_minimum_dir_info(void)
 
     if (!num_usable || !num_present) {
       tor_snprintf(dir_info_status, sizeof(dir_info_status),
-                   "We have only %d/%d usable entry node descriptors.",
-                   num_present, num_usable);
+                   "We have only %d/%d usable entry node %sdescriptors.",
+                   num_present, num_usable, using_md?"micro":"");
       res = 0;
       goto done;
     }



More information about the tor-commits mailing list