r15849@catbus: nickm | 2007-10-16 10:24:38 -0400

Correct and additional fix to bug 529.


svn:r11985
This commit is contained in:
Nick Mathewson 2007-10-16 14:25:16 +00:00
parent 03ce9d3ee7
commit c5fb1c19eb

View File

@ -1172,16 +1172,28 @@ routers_update_status_from_consensus_networkstatus(smartlist_t *routers,
rs = smartlist_get(ns->routerstatus_list, idx); rs = smartlist_get(ns->routerstatus_list, idx);
} }
if (r>0) { if (r>0) {
/* We have no routerstatus for this router. Skip it. */ /* We have no routerstatus for this router. Clear flags and skip it. */
if (!authdir) {
router->is_named = 0; router->is_named = 0;
if (router->purpose == ROUTER_PURPOSE_GENERAL) {
router->is_valid = router->is_running =
router->is_fast = router->is_stable =
router->is_possible_guard = router->is_exit =
router->is_bad_exit = 0;
}
}
continue; continue;
} }
tor_assert(r==0); tor_assert(r==0);
ds = router_get_trusteddirserver_by_digest(digest); ds = router_get_trusteddirserver_by_digest(digest);
if (!namingdir) if (!namingdir) {
router->is_named = rs->is_named; if (rs->is_named && !strcasecmp(router->nickname, rs->nickname))
router->is_named = 1;
else
router->is_named = 0;
}
if (!authdir) { if (!authdir) {
/* If we're not an authdir, believe others. */ /* If we're not an authdir, believe others. */
@ -1192,10 +1204,6 @@ routers_update_status_from_consensus_networkstatus(smartlist_t *routers,
router->is_possible_guard = rs->is_possible_guard; router->is_possible_guard = rs->is_possible_guard;
router->is_exit = rs->is_exit; router->is_exit = rs->is_exit;
router->is_bad_exit = rs->is_bad_exit; router->is_bad_exit = rs->is_bad_exit;
if (rs->is_named && !strcasecmp(router->nickname, rs->nickname))
router->is_named = 1;
else
router->is_named = 0;
} }
if (router->is_running && ds) { if (router->is_running && ds) {
download_status_reset(&ds->v2_ns_dl_status); download_status_reset(&ds->v2_ns_dl_status);