summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-12-24 10:31:39 +0000
committerRoger Dingledine <arma@torproject.org>2007-12-24 10:31:39 +0000
commit4fb573fddd65ef193be56118624f8001d03147ee (patch)
treef5b7d596fbfd0276459cfee1dda209cb691a3e09 /src/or/circuitbuild.c
parentda06bfb80fdb0f356cd5cf5746c06492afec0f78 (diff)
downloadtor-4fb573fddd65ef193be56118624f8001d03147ee.tar.gz
tor-4fb573fddd65ef193be56118624f8001d03147ee.zip
bugfix on r10612:
When we load a bridge descriptor from the cache, and it was previously unreachable, mark it as retriable so we won't just ignore it. Also, try fetching a new copy immediately. svn:r12950
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 851d7ff430..c28e4c8652 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2054,8 +2054,10 @@ add_an_entry_guard(routerinfo_t *chosen, int reset_status)
router = chosen;
entry = is_an_entry_guard(router->cache_info.identity_digest);
if (entry) {
- if (reset_status)
+ if (reset_status) {
entry->bad_since = 0;
+ entry->can_retry = 1;
+ }
return NULL;
}
} else {
@@ -3030,7 +3032,7 @@ fetch_bridge_descriptors(time_t now)
/** We just learned a descriptor for a bridge. See if that
* digest is in our entry guard list, and add it if not. */
void
-learned_bridge_descriptor(routerinfo_t *ri)
+learned_bridge_descriptor(routerinfo_t *ri, int from_cache)
{
tor_assert(ri);
tor_assert(ri->purpose == ROUTER_PURPOSE_BRIDGE);
@@ -3042,10 +3044,12 @@ learned_bridge_descriptor(routerinfo_t *ri)
if (bridge) { /* if we actually want to use this one */
/* it's here; schedule its re-fetch for a long time from now. */
- bridge_fetch_status_arrived(bridge, now);
+ if (!from_cache)
+ bridge_fetch_status_arrived(bridge, now);
add_an_entry_guard(ri, 1);
- log_notice(LD_DIR, "new bridge descriptor '%s'", ri->nickname);
+ log_notice(LD_DIR, "new bridge descriptor '%s' (%s)", ri->nickname,
+ from_cache ? "cached" : "fresh");
if (first)
routerlist_retry_directory_downloads(now);
}