[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.2.3] Warn at parse time for routerstatus entry missing a microdesc consensus



commit 063138e001d3608b1e8b6619661d906cfea74ae0
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue Jul 31 11:00:18 2012 -0400

    Warn at parse time for routerstatus entry missing a microdesc consensus
    
    In 0.2.3.18-rc, we started warning on this case while building a
    list of missing microdescriptor digests.  That turned out to spam
    the logs; instead let's warn at parse time.
    
    Partial fix for bug 6404.
---
 changes/bug6404      |    4 ++++
 src/or/microdesc.c   |    7 +------
 src/or/routerparse.c |    5 +++++
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/changes/bug6404 b/changes/bug6404
index 64d4594..7708148 100644
--- a/changes/bug6404
+++ b/changes/bug6404
@@ -10,3 +10,7 @@
       agree on a microdescriptor.  Partial fix for bug 6404; fix on
       0.2.2.6-alpha.
 
+    - Move log message when unable to find a microdesc in a
+      routerstatus entry to parse time. Previously we'd spam this
+      warning every time we tried to figure out which microdescriptors
+      to download. Partial fix for bug 6404; fix on 0.2.3.18-rc.
diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index 9395a9a..c1ac1c3 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -643,13 +643,8 @@ microdesc_list_missing_digest256(networkstatus_t *ns, microdesc_cache_t *cache,
       continue;
     if (skip && digestmap_get(skip, rs->descriptor_digest))
       continue;
-    if (tor_mem_is_zero(rs->descriptor_digest, DIGEST256_LEN)) {
-      log_info(LD_BUG, "Found an entry in networkstatus with no "
-               "microdescriptor digest. (Router %s=%s at %s:%d.)",
-               rs->nickname, hex_str(rs->identity_digest, DIGEST_LEN),
-               fmt_addr32(rs->addr), rs->or_port);
+    if (tor_mem_is_zero(rs->descriptor_digest, DIGEST256_LEN))
       continue;
-    }
     /* XXXX Also skip if we're a noncache and wouldn't use this router.
      * XXXX NM Microdesc
      */
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 4231a17..8b69ad1 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -2201,6 +2201,11 @@ routerstatus_parse_entry_from_string(memarea_t *area,
                  escaped(tok->args[0]));
         goto err;
       }
+    } else {
+      log_info(LD_BUG, "Found an entry in networkstatus with no "
+               "microdescriptor digest. (Router %s=%s at %s:%d.)",
+               rs->nickname, hex_str(rs->identity_digest, DIGEST_LEN),
+               fmt_addr32(rs->addr), rs->or_port);
     }
   }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits