From bdca5476daa900813fcc3ad04b3e952dcaddc994 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Sat, 20 Jun 2009 01:52:59 -0400 Subject: the second piece of bug 969 fixing whenever we remove a relay from the main routerlist, tell the rephist module that it's no longer running. --- src/or/routerlist.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/or/routerlist.c') diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 392b07b629..42b385b101 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2629,7 +2629,7 @@ routerlist_insert_old(routerlist_t *rl, routerinfo_t *ri) * If make_old is true, instead of deleting the router, we try adding * it to rl->old_routers. */ void -routerlist_remove(routerlist_t *rl, routerinfo_t *ri, int make_old) +routerlist_remove(routerlist_t *rl, routerinfo_t *ri, int make_old, time_t now) { routerinfo_t *ri_tmp; extrainfo_t *ei_tmp; @@ -2637,6 +2637,9 @@ routerlist_remove(routerlist_t *rl, routerinfo_t *ri, int make_old) tor_assert(0 <= idx && idx < smartlist_len(rl->routers)); tor_assert(smartlist_get(rl->routers, idx) == ri); + /* make sure the rephist module knows that it's not running */ + rep_hist_note_router_unreachable(ri->cache_info.identity_digest, now); + ri->cache_info.routerlist_index = -1; smartlist_del(rl->routers, idx); if (idx < smartlist_len(rl->routers)) { @@ -3328,7 +3331,7 @@ routerlist_remove_old_routers(void) log_info(LD_DIR, "Forgetting obsolete (too old) routerinfo for router '%s'", router->nickname); - routerlist_remove(routerlist, router, 1); + routerlist_remove(routerlist, router, 1, now); i--; } } -- cgit v1.2.3-54-g00ecf