aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-03-25 15:27:06 -0400
committerNick Mathewson <nickm@torproject.org>2011-03-25 16:28:37 -0400
commit444e46d96d05c3e12eca02769512c74f2eb16b48 (patch)
tree8022be33173ebd198e25c00dd90eae88ca3f9778 /src/or
parentfe86be61b6d84fbb442b13aa52139e6a3892dac0 (diff)
downloadtor-444e46d96d05c3e12eca02769512c74f2eb16b48.tar.gz
tor-444e46d96d05c3e12eca02769512c74f2eb16b48.zip
Remove the "fuzzy time" code
It was the start of a neat idea, but it only got used in 3 places, none of which really needed it.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/networkstatus.c6
-rw-r--r--src/or/routerlist.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 687ac03fa0..155dffe630 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1764,7 +1764,11 @@ networkstatus_set_current_consensus(const char *consensus,
write_str_to_file(consensus_fname, consensus, 0);
}
- if (ftime_definitely_before(now, current_consensus->valid_after)) {
+/** 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 - current_consensus->valid_after;
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 4421d5cf81..2dca57899a 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -328,7 +328,7 @@ trusted_dirs_remove_old_certs(void)
time_t cert_published;
if (newest == cert)
continue;
- expired = ftime_definitely_after(now, cert->expires);
+ expired = now > cert->expires;
cert_published = cert->cache_info.published_on;
/* Store expired certs for 48 hours after a newer arrives;
*/
@@ -520,7 +520,7 @@ authority_certs_fetch_missing(networkstatus_t *status, time_t now)
continue;
cl = get_cert_list(ds->v3_identity_digest);
SMARTLIST_FOREACH(cl->certs, authority_cert_t *, cert, {
- if (!ftime_definitely_after(now, cert->expires)) {
+ if (now < cert->expires) {
/* It's not expired, and we weren't looking for something to
* verify a consensus with. Call it done. */
download_status_reset(&cl->dl_status);