summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-10-30 15:17:07 +0000
committerNick Mathewson <nickm@torproject.org>2007-10-30 15:17:07 +0000
commitc0c2001a5b8fd3907c7ba93eccbd536786f57594 (patch)
treec7aa35ecb0eab620cbd592451600347410da4dee /src/or/directory.c
parent7709fb7143cc272c04f9de3970e4ac0fe3a000d6 (diff)
downloadtor-c0c2001a5b8fd3907c7ba93eccbd536786f57594.tar.gz
tor-c0c2001a5b8fd3907c7ba93eccbd536786f57594.zip
r16279@catbus: nickm | 2007-10-30 11:14:29 -0400
Improved skew reporting: "You are 365 days in the duture" is more useful than "You are 525600 minutes in the future". Also, when we get something that proves we are at least an hour in the past, tell the controller "CLOCK_SKEW MIN_SKEW=-3600" rather than just "CLOCK_SKEW" svn:r12283
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index a780c00786..372dd27c5a 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1250,14 +1250,18 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
*/
delta = conn->_base.timestamp_lastwritten - date_header;
if (abs(delta)>ALLOW_DIRECTORY_TIME_SKEW) {
+ char dbuf[64];
int trusted = router_digest_is_trusted_dir(conn->identity_digest);
+ format_time_interval(dbuf, sizeof(dbuf), delta);
log_fn(trusted ? LOG_WARN : LOG_INFO,
LD_HTTP,
"Received directory with skewed time (server '%s:%d'): "
- "we are %d minutes %s, or the directory is %d minutes %s.",
+ "It seems that our clock is %s by %s, or that theirs is %s. "
+ "Tor requires an accurate clock to work: please check your time "
+ "and date settings.",
conn->_base.address, conn->_base.port,
- abs(delta)/60, delta>0 ? "ahead" : "behind",
- abs(delta)/60, delta>0 ? "behind" : "ahead");
+ delta>0 ? "ahead" : "behind", dbuf,
+ delta>0 ? "behind" : "ahead");
skewed = 1; /* don't check the recommended-versions line */
control_event_general_status(trusted ? LOG_WARN : LOG_NOTICE,
"CLOCK_SKEW SKEW=%d SOURCE=DIRSERV:%s:%d",