summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-04-07 12:17:20 -0400
committerNick Mathewson <nickm@torproject.org>2011-04-07 12:17:20 -0400
commit67d88a7d6021e95a2d423a9f26811accd1da39b6 (patch)
tree30d48f5f922b928f7727ed812905101e5bf24012 /src/or/networkstatus.c
parent07ab483e62457ee56187037304f25ec50cb0850a (diff)
parentba0cd8094f8e6ae0113ad69958d9d0973bb1f2c3 (diff)
downloadtor-67d88a7d6021e95a2d423a9f26811accd1da39b6.tar.gz
tor-67d88a7d6021e95a2d423a9f26811accd1da39b6.zip
Merge remote-tracking branch 'origin/maint-0.2.2'
Conflicts: src/common/address.c src/common/compat_libevent.c src/common/memarea.c src/common/util.h src/or/buffers.c src/or/circuitbuild.c src/or/circuituse.c src/or/connection.c src/or/directory.c src/or/networkstatus.c src/or/or.h src/or/routerlist.c
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 6387126393..50982d715d 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1630,7 +1630,7 @@ networkstatus_set_current_consensus(const char *consensus,
if (from_cache && !accept_obsolete &&
c->valid_until < now-OLD_ROUTER_DESC_MAX_AGE) {
- /* XXX022 when we try to make fallbackconsensus work again, we should
+ /* XXXX If we try to make fallbackconsensus work again, we should
* consider taking this out. Until then, believing obsolete consensuses
* is causing more harm than good. See also bug 887. */
log_info(LD_DIR, "Loaded an expired consensus. Discarding.");
@@ -1790,7 +1790,8 @@ networkstatus_set_current_consensus(const char *consensus,
routerstatus_list_update_named_server_map();
cell_ewma_set_scale_factor(options, current_consensus);
- /* XXX022 where is the right place to put this call? */
+ /* XXXX023 this call might be unnecessary here: can changing the
+ * current consensus really alter our view of any OR's rate limits? */
connection_or_update_token_buckets(get_connection_array(), options);
circuit_build_times_new_consensus_params(&circ_times, current_consensus);
@@ -1807,7 +1808,11 @@ networkstatus_set_current_consensus(const char *consensus,
write_str_to_file(consensus_fname, consensus, 0);
}
- if (time_definitely_before(now, c->valid_after, 60)) {
+/** If a consensus appears more than this many seconds before its declared
+ * valid-after time, declare that our clock is skewed. */
+#define EARLY_CONSENSUS_NOTICE_SKEW 60
+
+ if (now < current_consensus->valid_after - EARLY_CONSENSUS_NOTICE_SKEW) {
char tbuf[ISO_TIME_LEN+1];
char dbuf[64];
long delta = now - c->valid_after;