summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-05-16 10:57:08 -0400
committerNick Mathewson <nickm@torproject.org>2012-05-16 10:57:08 -0400
commita3046fd5e576bc7294374a8bbab1a80cd3fb3524 (patch)
tree462d450191f9d41c5fe6cf51c63175d750cf0ca8 /src
parentee246bbe95a3adbc86ac8eb3794f55011c2059d5 (diff)
parent3ed4c5dc05a1954a8c68d0f7e9fb802f3155d308 (diff)
downloadtor-a3046fd5e576bc7294374a8bbab1a80cd3fb3524.tar.gz
tor-a3046fd5e576bc7294374a8bbab1a80cd3fb3524.zip
Merge remote-tracking branch 'origin/maint-0.2.2'
Diffstat (limited to 'src')
-rw-r--r--src/or/routerlist.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index a64b93f3a9..a32cae6e9b 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2838,6 +2838,13 @@ routerlist_insert(routerlist_t *rl, routerinfo_t *ri)
ri->cache_info.signed_descriptor_digest,
&(ri->cache_info));
if (sd_old) {
+ int idx = sd_old->routerlist_index;
+ sd_old->routerlist_index = -1;
+ smartlist_del(rl->old_routers, idx);
+ if (idx < smartlist_len(rl->old_routers)) {
+ signed_descriptor_t *d = smartlist_get(rl->old_routers, idx);
+ d->routerlist_index = idx;
+ }
rl->desc_store.bytes_dropped += sd_old->signed_descriptor_len;
sdmap_remove(rl->desc_by_eid_map, sd_old->extra_info_digest);
signed_descriptor_free(sd_old);