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

[or-cvs] r11808: Recompute voting schedule whenever a consensus is set. (in tor/trunk: . src/or)



Author: nickm
Date: 2007-10-09 14:36:56 -0400 (Tue, 09 Oct 2007)
New Revision: 11808

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/dirvote.c
   tor/trunk/src/or/networkstatus.c
Log:
 r15581@catbus:  nickm | 2007-10-09 14:36:47 -0400
 Recompute voting schedule whenever a consensus is set.



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

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-10-09 18:04:27 UTC (rev 11807)
+++ tor/trunk/ChangeLog	2007-10-09 18:36:56 UTC (rev 11808)
@@ -39,6 +39,7 @@
     - Only change the reply to a vote to "OK" if it's not already set.  This
       gets rid of annoying "400 OK" log messages, which may have been masking
       some deeper issue.  Bugfix on 0.2.0.7-alpha.
+    - When we get a valid consensus, recompute the voting schedule.
 
   o Minor bugfixes (performance):
     - Use a slightly simpler string hashing algorithm (copying Python's

Modified: tor/trunk/src/or/dirvote.c
===================================================================
--- tor/trunk/src/or/dirvote.c	2007-10-09 18:04:27 UTC (rev 11807)
+++ tor/trunk/src/or/dirvote.c	2007-10-09 18:36:56 UTC (rev 11808)
@@ -1080,8 +1080,6 @@
 void
 dirvote_recalculate_timing(time_t now)
 {
-  /* XXXX020 call this when inputs may have changed (i.e., whenver we get a
-   * fresh consensus.) */
   int interval, vote_delay, dist_delay;
   time_t start;
   time_t end;
@@ -1361,6 +1359,7 @@
  again:
   vote = networkstatus_parse_vote_from_string(vote_body, &end_of_vote, 1);
   if (!vote) {
+    log_warn(LD_DIR, "Couldn't parse vote: length was %d", strlen(vote_body));
     *msg_out = "Unable to parse vote";
     goto err;
   }

Modified: tor/trunk/src/or/networkstatus.c
===================================================================
--- tor/trunk/src/or/networkstatus.c	2007-10-09 18:04:27 UTC (rev 11807)
+++ tor/trunk/src/or/networkstatus.c	2007-10-09 18:36:56 UTC (rev 11808)
@@ -1015,6 +1015,7 @@
   current_consensus = c;
 
   update_consensus_networkstatus_fetch_time(now);
+  dirvote_recalculate_timing(now);
 
   if (!from_cache) {
     or_options_t *options = get_options();