From 937ccb270ef87dc24e30fcca15dd23ebd20873ab Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Thu, 18 Oct 2001 01:40:56 +0000 Subject: [PATCH] The call to incremental_cleaning_action() added to cleaning_timer_action() in revision 1.40 is clearly incorrect. If the cleaner is already in the busy state, a call to incremental_cleaning_action() has already been scheduled as an event, and there is no need to do an extra call. Furthermore, the call passed the timer event as an argument to incremental_cleaning_action(), which would ultimately cause it to be passed to end_cleanin() and assigned to cleaner->resched_event rather than freed. This commit may or may not fix RT #1912. --- lib/dns/cache.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/dns/cache.c b/lib/dns/cache.c index 39127e5d1d..7d18def068 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cache.c,v 1.45 2001/07/02 20:44:30 gson Exp $ */ +/* $Id: cache.c,v 1.46 2001/10/18 01:40:56 gson Exp $ */ #include @@ -622,16 +622,10 @@ cleaning_timer_action(isc_task_t *task, isc_event_t *event) { INSIST(task == cleaner->task); INSIST(event->ev_type == ISC_TIMEREVENT_TICK); - if (cleaner->state == cleaner_s_idle) { + if (cleaner->state == cleaner_s_idle) begin_cleaning(cleaner); - isc_event_free(&event); - } else - /* - * incremental_cleaning_action() takes responsibility - * for freeing or preserving the event. - */ - incremental_cleaning_action(task, event); + isc_event_free(&event); } /* @@ -679,8 +673,7 @@ incremental_cleaning_action(isc_task_t *task, isc_event_t *event) { UNUSED(task); INSIST(task == cleaner->task); - INSIST(event->ev_type == DNS_EVENT_CACHECLEAN || - event->ev_type == ISC_TIMEREVENT_TICK); + INSIST(event->ev_type == DNS_EVENT_CACHECLEAN); if (cleaner->state == cleaner_s_done) { cleaner->state = cleaner_s_busy;