summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-03-17 04:41:57 +0000
committerNick Mathewson <nickm@torproject.org>2006-03-17 04:41:57 +0000
commit215e37722461e7711caed40e221a9c7bd9d4f1ab (patch)
tree24bb85a997a14b4df12079c19eda6a727ec4fc91
parent9a5df4cef51c33e92ecf924f66f5c794e6607ccf (diff)
downloadtor-215e37722461e7711caed40e221a9c7bd9d4f1ab.tar.gz
tor-215e37722461e7711caed40e221a9c7bd9d4f1ab.zip
Only warn about lack of name binding for self if we have tried downloading every networkstatus.
svn:r6172
-rw-r--r--src/or/routerlist.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 2ab8f4d8e5..cf23c347ed 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -33,6 +33,7 @@ static void update_networkstatus_cache_downloads(time_t now);
static void update_networkstatus_client_downloads(time_t now);
static int signed_desc_digest_is_recognized(signed_descriptor_t *desc);
static void routerlist_assert_ok(routerlist_t *rl);
+static int have_tried_downloading_all_statuses(void);
#define MAX_DESCRIPTORS_PER_ROUTER 5
@@ -2815,7 +2816,7 @@ routers_update_all_from_networkstatus(void)
"consider sending your identity fingerprint to the tor-ops.",
n_recent-n_valid, n_recent);
have_warned_about_unverified_status = 1;
- } else if (!n_named && n_naming) { // (n_named <= n_recent/2) {
+ } else if (!n_named && have_tried_downloading_all_statuses()) {
log_warn(LD_GENERAL, "0/%d name-binding directory authorities "
"recognize this server. Please consider sending your "
"identity fingerprint to the tor-ops.",
@@ -3691,6 +3692,26 @@ router_have_minimum_dir_info(void)
return res;
}
+/** Return true iff we have downloaded, or attempted to download, a network
+ * status for each authority. */
+static int
+have_tried_downloading_all_statuses(void)
+{
+ if (!trusted_dir_servers)
+ return 0;
+
+ SMARTLIST_FOREACH(trusted_dir_servers, trusted_dir_server_t *, ds,
+ {
+ /* If we don't have the status, and we haven't failed to get the status,
+ * we haven't tried to get the status. */
+ if (!networkstatus_get_by_digest(ds->digest) &&
+ !ds->n_networkstatus_failures)
+ return 0;
+ });
+
+ return 1;
+}
+
/** Reset the descriptor download failure count on all routers, so that we
* can retry any long-failed routers immediately.
*/