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

[tor-commits] [tor/master] Use the DL_SCHED_CONSENSUS schedule for consensuses.



commit d14127eb7adfb92b1790f0aaa65089cfb6c71094
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Sep 18 10:51:44 2014 -0400

    Use the DL_SCHED_CONSENSUS schedule for consensuses.
    
    Fixes bug 11679; bugfix on 0.2.2.6-alpha
---
 changes/bug11679       |    3 +++
 src/or/networkstatus.c |    9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/changes/bug11679 b/changes/bug11679
new file mode 100644
index 0000000..3a191ce
--- /dev/null
+++ b/changes/bug11679
@@ -0,0 +1,3 @@
+  o Minor bugfixes (client):
+    - Use the consensus schedule for downloading consensuses, and not the
+      generic schedule. Fixes bug 11679; bugfix on 0.2.2.6-alpha.
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 95eb320..c7bed9b 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -83,7 +83,11 @@ static consensus_waiting_for_certs_t
  * before the current consensus becomes invalid. */
 static time_t time_to_download_next_consensus[N_CONSENSUS_FLAVORS];
 /** Download status for the current consensus networkstatus. */
-static download_status_t consensus_dl_status[N_CONSENSUS_FLAVORS];
+static download_status_t consensus_dl_status[N_CONSENSUS_FLAVORS] =
+  {
+    { 0, 0, DL_SCHED_CONSENSUS },
+    { 0, 0, DL_SCHED_CONSENSUS },
+  };
 
 /** True iff we have logged a warning about this OR's version being older than
  * listed by the authorities. */
@@ -754,6 +758,9 @@ update_consensus_networkstatus_downloads(time_t now)
 
     resource = networkstatus_get_flavor_name(i);
 
+    /* Let's make sure we remembered to update consensus_dl_status */
+    tor_assert(consensus_dl_status[i].schedule == DL_SCHED_CONSENSUS);
+
     if (!download_status_is_ready(&consensus_dl_status[i], now,
                              options->TestingConsensusMaxDownloadTries))
       continue; /* We failed downloading a consensus too recently. */

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