[or-cvs] r11097: Add some insanely verbose log messages on voting authorities (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Mon Aug 13 23:23:06 UTC 2007


Author: nickm
Date: 2007-08-13 19:23:06 -0400 (Mon, 13 Aug 2007)
New Revision: 11097

Modified:
   tor/trunk/
   tor/trunk/src/or/dirvote.c
   tor/trunk/src/or/routerlist.c
Log:
 r13998 at kushana:  nickm | 2007-08-13 19:20:28 -0400
 Add some insanely verbose log messages on voting authorities.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13998] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/src/or/dirvote.c
===================================================================
--- tor/trunk/src/or/dirvote.c	2007-08-13 22:57:03 UTC (rev 11096)
+++ tor/trunk/src/or/dirvote.c	2007-08-13 23:23:06 UTC (rev 11097)
@@ -1084,12 +1084,14 @@
   if (!voting_schedule.voting_starts)
     dirvote_recalculate_timing(now);
   if (voting_schedule.voting_starts < now && !voting_schedule.have_voted) {
+    log_notice(LD_DIR, "Time to vote.");
     dirvote_perform_vote();
     voting_schedule.have_voted = 1;
   }
   /* XXXX020 after a couple minutes here, start trying to fetch votes. */
   if (voting_schedule.voting_ends < now &&
       !voting_schedule.have_built_consensus) {
+    log_notice(LD_DIR, "Time to compute a consensus.");
     dirvote_compute_consensus();
     /* XXXX020 we will want to try again later if we haven't got enough
      * votes yet. */
@@ -1097,12 +1099,14 @@
   }
   if (voting_schedule.interval_starts < now &&
       !voting_schedule.have_published_consensus) {
+    log_notice(LD_DIR, "Time to publish the consensus.");
     dirvote_publish_consensus();
     /* XXXX020 we will want to try again later if we haven't got enough
      * signatures yet. */
     voting_schedule.have_published_consensus = 1;
   }
   if (voting_schedule.discard_old_votes < now) {
+    log_notice(LD_DIR, "Time to discard old votes consensus.");
     dirvote_clear_pending_votes();
     dirvote_recalculate_timing(now);
   }
@@ -1148,6 +1152,7 @@
                                V3_AUTHORITY,
                                pending_vote->vote_body->dir,
                                pending_vote->vote_body->dir_len, 0);
+  log_notice(LD_DIR, "Vote posted.");
 }
 
 /** DOCDOC */
@@ -1168,6 +1173,7 @@
                       tor_free(cp));
     smartlist_clear(pending_consensus_signature_list);
   }
+  log_notice(LD_DIR, "Pending votes cleared.");
 }
 
 /** DOCDOC */
@@ -1327,6 +1333,7 @@
     smartlist_clear(pending_consensus_signature_list);
   }
 
+  log_notice(LD_DIR, "Consensus computed.");
   return 0;
  err:
   if (votes)
@@ -1418,10 +1425,15 @@
 {
   /* Can we actually publish it yet? */
   if (!pending_consensus ||
-      networkstatus_check_consensus_signature(pending_consensus)<0)
+      networkstatus_check_consensus_signature(pending_consensus)<0) {
+    log_warn(LD_DIR, "Not enough info to publish pending consensus");
     return -1;
+  }
 
-  networkstatus_set_current_consensus(pending_consensus_body, 0);
+  if (networkstatus_set_current_consensus(pending_consensus_body, 0))
+    log_warn(LD_DIR, "Error publishing consensus");
+  else
+    log_warn(LD_DIR, "Consensus published.");
   return 0;
 }
 

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-08-13 22:57:03 UTC (rev 11096)
+++ tor/trunk/src/or/routerlist.c	2007-08-13 23:23:06 UTC (rev 11097)
@@ -3868,11 +3868,14 @@
   networkstatus_vote_t *c;
   /* Make sure it's parseable. */
   c = networkstatus_parse_vote_from_string(consensus, 0);
-  if (!c)
+  if (!c) {
+    log_warn(LD_DIR, "Unable to parse networkstatus consensus");
     return -1;
+  }
 
   /* Make sure it's signed enough. */
   if (networkstatus_check_consensus_signature(c)<0) {
+    log_warn(LD_DIR, "Not enough good signatures on networkstatus consensus");
     networkstatus_vote_free(c);
     return -1;
   }



More information about the tor-commits mailing list