aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-02-21 06:06:45 +0000
committerRoger Dingledine <arma@torproject.org>2008-02-21 06:06:45 +0000
commit828c707812553f210979bff32ee31381dec90a2d (patch)
tree66b306e1c7b6eeade30d95076c741b5de83fefec /src
parentb28a342e352ae7c94130382442507f96a80c427e (diff)
downloadtor-828c707812553f210979bff32ee31381dec90a2d.tar
tor-828c707812553f210979bff32ee31381dec90a2d.tar.gz
Change the behavior of "getinfo status/good-server-descriptor"
so it doesn't return failure when any authority disappears. svn:r13645
Diffstat (limited to 'src')
-rw-r--r--src/or/directory.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 900e9a2e7..a1473135a 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -192,24 +192,26 @@ router_supports_extrainfo(const char *identity_digest, int is_authority)
return 0;
}
-/** Return true iff all trusted directory servers have accepted our
- * server descriptor. */
+/** Return true iff any trusted directory authority has accepted our
+ * server descriptor.
+ *
+ * We consider any authority sufficient because waiting for all of
+ * them means it never happens while any authority is down; we don't
+ * go for something more complex in the middle (like \>1/3 or \>1/2 or
+ * \>=1/2) because that doesn't seem necessary yet.
+ */
int
directories_have_accepted_server_descriptor(void)
{
smartlist_t *servers = router_get_trusted_dir_servers();
or_options_t *options = get_options();
- /* XXX020rc If any authority of the needed type is down, this
- * function will never return true. Perhaps we need to be
- * tolerant of down servers? Or even better, should we change
- * this so one successful upload is enough? -RD */
SMARTLIST_FOREACH(servers, trusted_dir_server_t *, d, {
if ((d->type & options->_PublishServerDescriptor) &&
- !d->has_accepted_serverdesc) {
- return 0;
+ d->has_accepted_serverdesc) {
+ return 1;
}
});
- return 1;
+ return 0;
}
/** Start a connection to every suitable directory authority, using