Ticket #1776: 158081

File 158081, 658 bytes (added by asn, 9 years ago)

non-extended version of wanoskarnet's patch

Line 
1--- routerlist.c.orig   2012-02-29
2+++ routerlist.c        2012-02-29
3@@ -2838,6 +2838,13 @@
4                      ri->cache_info.signed_descriptor_digest,
5                      &(ri->cache_info));
6   if (sd_old) {
7+    int idx = sd_old->routerlist_index;
8+    sd_old->routerlist_index = -1;
9+    smartlist_del(rl->old_routers, idx);
10+    if (idx < smartlist_len(rl->old_routers)) {
11+       signed_descriptor_t *d = smartlist_get(rl->old_routers, idx);
12+       d->routerlist_index = idx;
13+    }
14     rl->desc_store.bytes_dropped += sd_old->signed_descriptor_len;
15     sdmap_remove(rl->desc_by_eid_map, sd_old->extra_info_digest);
16     signed_descriptor_free(sd_old);