diff options
author | Roger Dingledine <arma@torproject.org> | 2007-05-10 05:12:20 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-05-10 05:12:20 +0000 |
commit | cd23b65a0771ddfb1b40aae126a3abd2bf33dadf (patch) | |
tree | fa89337faec92a9d45826b13e981ad098230a0f2 /src/or/routerlist.c | |
parent | 8e8144cd5893c22b2b60bc1ad0ebda715848baec (diff) | |
download | tor-cd23b65a0771ddfb1b40aae126a3abd2bf33dadf.tar.gz tor-cd23b65a0771ddfb1b40aae126a3abd2bf33dadf.zip |
Backport candidate: count it as a failure if we fetch a valid
network-status but we don't want to keep it. Otherwise we'll keep fetching
it and keep not wanting to keep it. Fixes part of bug 422.
svn:r10153
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index e693090989..02c04a81ff 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2795,6 +2795,7 @@ router_set_networkstatus(const char *s, time_t arrived_at, ns->networkstatus_digest, DIGEST_LEN)) { /* Same one we had before. */ networkstatus_free(ns); + tor_assert(trusted_dir); log_info(LD_DIR, "Not replacing network-status from %s (published %s); " "we already have it.", @@ -2809,16 +2810,19 @@ router_set_networkstatus(const char *s, time_t arrived_at, } old_ns->received_on = arrived_at; } + ++trusted_dir->n_networkstatus_failures; return 0; } else if (old_ns->published_on >= ns->published_on) { char old_published[ISO_TIME_LEN+1]; format_iso_time(old_published, old_ns->published_on); + tor_assert(trusted_dir); log_info(LD_DIR, "Not replacing network-status from %s (published %s);" " we have a newer one (published %s) for this authority.", trusted_dir->description, published, old_published); networkstatus_free(ns); + ++trusted_dir->n_networkstatus_failures; return 0; } else { networkstatus_free(old_ns); |