From 2ded13ecdc3e102657daa0cc45d4c44602b5e327 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Sun, 13 May 2007 00:14:48 +0000 Subject: [PATCH] backport r10175 svn:r10176 --- ChangeLog | 3 +++ src/or/routerlist.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 998f160fb..6a8d65f95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ Changes in version 0.1.2.14 - 2007-0?-?? behavior. (Reported by seeess, fixes bug 425.) - Fix a bug in dirserv_remove_invalid() that would cause authorities to corrupt memory under some really unlikely scenarios. + - If a directory authority is down, skip it when deciding where to get + networkstatus objects or descriptors. Otherwise we keep asking + every 10 seconds forever. o Minor bugfixes: - Actually set the purpose correctly for descriptors inserted with diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 92577f074..3cd450980 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -4051,6 +4051,7 @@ update_router_descriptor_cache_downloads(time_t now) n_download = 0; SMARTLIST_FOREACH(networkstatus_list, networkstatus_t *, ns, { + trusted_dir_server_t *ds; smartlist_t *dl; dl = downloadable[ns_sl_idx] = smartlist_create(); download_from[ns_sl_idx] = smartlist_create(); @@ -4064,6 +4065,13 @@ update_router_descriptor_cache_downloads(time_t now) * we take this clause out. -RD */ continue; } + + /* Don't try dirservers that we think are down -- we might have + * just tried them and just marked them as down. */ + ds = router_get_trusteddirserver_by_digest(ns->identity_digest); + if (ds && !ds->is_running) + continue; + SMARTLIST_FOREACH(ns->entries, routerstatus_t * , rs, { if (!rs->need_to_mirror)