From daf63c7e8900c216ea4683ee6c03b300bdb9e353 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Tue, 26 May 2009 14:42:14 +0000 Subject: [PATCH] Fixup assertion that no longer holds (since the new DoS prevention code jostles out old queries). git-svn-id: file:///svn/unbound/trunk@1623 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 4 ++++ iterator/iterator.c | 14 ++++++++------ winrc/win_svc.c | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index fd436834b..ac25ecdb4 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +26 May 2009: Wouter + - Thanks again to Brett Carr, found an assertion that was not true. + Assertion checked if recursion parent query still existed. + 29 April 2009: Wouter - Thanks to Brett Carr, caught windows resource leak, use closesocket() and not close() on sockets or else the network stack diff --git a/iterator/iterator.c b/iterator/iterator.c index ff14b7f0d..d69d22f7b 100644 --- a/iterator/iterator.c +++ b/iterator/iterator.c @@ -1707,6 +1707,9 @@ processPrimeResponse(struct module_qstate* qstate, int id) struct iter_qstate* iq = (struct iter_qstate*)qstate->minfo[id]; enum response_type type = response_type_from_server(0, iq->response, &iq->qchase, iq->dp); + /* @@@ DEBUG - fail to prime roots often */ + /* if((ub_random(qstate->env->rnd) & 0x7) != 0) + type = RESPONSE_TYPE_ANSWER+1; */ if(type == RESPONSE_TYPE_ANSWER) { qstate->return_rcode = LDNS_RCODE_NOERROR; qstate->return_msg = iq->response; @@ -1766,16 +1769,15 @@ processTargetResponse(struct module_qstate* qstate, int id, log_query_info(VERB_ALGO, "processTargetResponse super", &forq->qinfo); /* check to see if parent event is still interested (in orig name). */ + if(!foriq->dp) + return; /* not interested anymore */ dpns = delegpt_find_ns(foriq->dp, qstate->qinfo.qname, qstate->qinfo.qname_len); if(!dpns) { - /* FIXME: maybe store this nameserver address in the cache - * anyways? */ - /* If not, just stop processing this event */ + /* If not interested, just stop processing this event */ verbose(VERB_ALGO, "subq: parent not interested anymore"); - /* this is an error, and will cause parent to be reactivated - * even though nothing has happened */ - log_assert(0); + /* could be because parent was jostled out of the cache, + and a new identical query arrived, that does not want it*/ return; } diff --git a/winrc/win_svc.c b/winrc/win_svc.c index 4b7e02aed..097695cf7 100644 --- a/winrc/win_svc.c +++ b/winrc/win_svc.c @@ -422,6 +422,7 @@ void worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void* arg) { struct worker* worker = (struct worker*)arg; + verbosity = 5; /* @@@ DEBUG */ verbose(VERB_QUERY, "caught stop signal (wsaevent)"); worker->need_to_exit = 1; comm_base_exit(worker->base);