diff options
author | Roger Dingledine <arma@torproject.org> | 2005-01-29 11:48:37 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-01-29 11:48:37 +0000 |
commit | d273891107da088e7272c276b4a7dc010145886a (patch) | |
tree | f19a08f6c1e0520255ba44fd3374ce9590ae779d /src/or/directory.c | |
parent | 191e52179c984786c25619fd41b8deeecda7ef48 (diff) | |
download | tor-d273891107da088e7272c276b4a7dc010145886a.tar tor-d273891107da088e7272c276b4a7dc010145886a.tar.gz |
if we fetch the dir from a mirror that has a wildly skewed
clock, then don't bother checking recommended-versions: it will
just make us sad.
as a side effect, people running obsolete versions and whose
clocks are wildly skewed will not be auto-shut-down. but they
will still get warns about their clock skew.
svn:r3459
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 62681ae84..e4a5d1555 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -592,6 +592,7 @@ connection_dir_client_reached_eof(connection_t *conn) int delta; int compression; int plausible; + int skewed=0; switch (fetch_from_buf_http(conn->inbuf, &headers, MAX_HEADERS_SIZE, @@ -621,6 +622,7 @@ connection_dir_client_reached_eof(connection_t *conn) conn->address, abs(delta)/60, delta>0 ? "ahead" : "behind", abs(delta)/60, delta>0 ? "behind" : "ahead"); + skewed = 1; /* don't check the recommended-versions line */ } else { log_fn(LOG_INFO, "Time on received directory is within tolerance; we are %d seconds skewed. (That's okay.)", delta); } @@ -692,9 +694,8 @@ connection_dir_client_reached_eof(connection_t *conn) tor_free(body); tor_free(headers); return -1; } - /* xxx maybe we can tell router_... here that it was skewed so don't believe it all. */ - if (router_load_routerlist_from_directory(body, NULL, 1, 0) < 0) { - log_fn(LOG_WARN,"I failed to parse the directory I fetched from %s:%d. Ignoring.", conn->address, conn->port); + if (router_load_routerlist_from_directory(body, NULL, skewed, 0) < 0) { + log_fn(LOG_NOTICE,"I failed to parse the directory I fetched from %s:%d. Ignoring.", conn->address, conn->port); } else { log_fn(LOG_INFO,"updated routers."); } |