Commit 4fb573fd authored by Roger Dingledine's avatar Roger Dingledine
Browse files

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
parent da06bfb8
Changes in version 0.2.0.15-alpha - 2008-01-??
o Minor bugfixes:
- Fix configure.in logic for cross-compilation.
- 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. Bugfixes
on 0.2.0.13-alpha.
o Minor features:
- Support compilation to target iPhone; patch from cjacker huang.
......
......@@ -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);
}
......
......@@ -2521,7 +2521,7 @@ int routerinfo_is_a_configured_bridge(routerinfo_t *ri);
void bridge_add_from_config(uint32_t addr, uint16_t port, char *digest);
void retry_bridge_descriptor_fetch_directly(char *digest);
void fetch_bridge_descriptors(time_t now);
void learned_bridge_descriptor(routerinfo_t *ri);
void learned_bridge_descriptor(routerinfo_t *ri, int from_cache);
int any_bridge_descriptors_known(void);
int bridges_known_but_down(void);
void bridges_retry_all(void);
......
......@@ -3053,13 +3053,13 @@ routerlist_remove_old_routers(void)
/** We just added a new set of descriptors. Take whatever extra steps
* we need. */
static void
routerlist_descriptors_added(smartlist_t *sl)
routerlist_descriptors_added(smartlist_t *sl, int from_cache)
{
tor_assert(sl);
control_event_descriptors_changed(sl);
SMARTLIST_FOREACH(sl, routerinfo_t *, ri,
if (ri->purpose == ROUTER_PURPOSE_BRIDGE)
learned_bridge_descriptor(ri);
learned_bridge_descriptor(ri, from_cache);
);
}
......@@ -3118,7 +3118,7 @@ router_load_single_router(const char *s, uint8_t purpose, int cache,
smartlist_free(lst);
return 0;
} else {
routerlist_descriptors_added(lst);
routerlist_descriptors_added(lst, 0);
smartlist_free(lst);
log_debug(LD_DIR, "Added router to list");
return 1;
......@@ -3182,7 +3182,7 @@ router_load_routers_from_string(const char *s, const char *eos,
if (router_add_to_routerlist(ri, &msg, from_cache, !from_cache) >= 0) {
smartlist_add(changed, ri);
routerlist_descriptors_added(changed);
routerlist_descriptors_added(changed, from_cache);
smartlist_clear(changed);
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment