backport patch from pre1:

Fix a rare assert trigger, where routerinfos for entries in our cpath
would expire while we're building the path.


svn:r2472
This commit is contained in:
Roger Dingledine
2004-10-13 21:15:02 +00:00
parent af112c7a1c
commit 05bab55b97
@@ -1079,9 +1079,9 @@ static routerinfo_t *choose_good_middle_server(cpath_build_state_t *state,
if((r = routerlist_find_my_routerinfo()))
smartlist_add(excluded, r);
for (i = 0, cpath = head; i < cur_len; ++i, cpath=cpath->next) {
r = router_get_by_digest(cpath->identity_digest);
tor_assert(r);
smartlist_add(excluded, r);
if((r = router_get_by_digest(cpath->identity_digest))) {
smartlist_add(excluded, r);
}
}
choice = router_choose_random_node("", options.ExcludeNodes, excluded,
0, 1, options._AllowUnverified & ALLOW_UNVERIFIED_MIDDLE, 0);