mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-23 14:40:51 +01:00
I so wonder how this blows up on the real network - make _routerlist_find_elt be strict about the idx it is passed - if it is not -1 then it has to be correct
svn:r10727
This commit is contained in:
parent
d071df748a
commit
64f4cff192
1 changed files with 5 additions and 3 deletions
|
@ -1867,15 +1867,17 @@ routerlist_is_overfull(routerlist_t *rl)
|
|||
static INLINE int
|
||||
_routerlist_find_elt(smartlist_t *sl, void *ri, int idx)
|
||||
{
|
||||
tor_assert(idx < smartlist_len(sl));
|
||||
if (idx < 0 || smartlist_get(sl, idx) != ri) {
|
||||
if (idx < 0) {
|
||||
idx = -1;
|
||||
SMARTLIST_FOREACH(sl, routerinfo_t *, r,
|
||||
if (r == ri) {
|
||||
idx = r_sl_idx;
|
||||
break;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
tor_assert(idx < smartlist_len(sl));
|
||||
tor_assert(smartlist_get(sl, idx) == ri);
|
||||
};
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue