From: Wouter Wijngaards Date: Fri, 15 Jun 2007 12:11:44 +0000 (+0000) Subject: Improve error handling. X-Git-Tag: release-0.4~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34c36a76168b9da478231c4bc7b84866c3efb38d;p=thirdparty%2Funbound.git Improve error handling. git-svn-id: file:///svn/unbound/trunk@391 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/worker.c b/daemon/worker.c index b5609eb7a..011924fee 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -271,17 +271,15 @@ worker_process_query(struct worker* worker, struct work_query* w, "exit state is %s", strextstate(s)); if(s == module_state_initial) { log_err("module exit in initial state, " - "it loops; aborted"); + "it loops; parent query is aborted"); + while(qstate->parent) + qstate = qstate->parent; s = module_error; } /* examine results, start further modules, etc. */ if(s != module_error && s != module_finished) { /* see if we can continue with other subrequests */ struct module_qstate* nxt = find_runnable(qstate); - if(s == module_wait_subquery && !nxt) { - log_err("module exit wait subq, but no subq"); - s = module_error; - } if(nxt) { /* start submodule */ qstate = nxt; diff --git a/doc/Changelog b/doc/Changelog index 615a2e6ee..475e15839 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -6,6 +6,9 @@ - when iterator moves on due to CNAME or referral, it will remove the subqueries (for other targets). These are put on the slumber list. + - state module wait subq is OK with no new subqs, an old one may have + stopped, with an error, and it is still waiting for other ones. + - if a query loops, halt entire query (easy way to clean up properly). 14 June 2007: Wouter - num query targets was > 0 , not >= 0 compared, so that fetch diff --git a/util/data/msgreply.c b/util/data/msgreply.c index 4b2c6e783..b0a1f9c29 100644 --- a/util/data/msgreply.c +++ b/util/data/msgreply.c @@ -450,9 +450,9 @@ query_info_parse(struct query_info* m, ldns_buffer* query) /* minimum size: header + \0 + qtype + qclass */ if(ldns_buffer_limit(query) < LDNS_HEADER_SIZE + 5) return 0; - log_assert(LDNS_OPCODE_WIRE(q) == LDNS_PACKET_QUERY); - log_assert(LDNS_QDCOUNT(q) == 1); - log_assert(ldns_buffer_position(query) == 0); + if(LDNS_OPCODE_WIRE(q) != LDNS_PACKET_QUERY || + LDNS_QDCOUNT(q) != 1 || ldns_buffer_position(query) != 0) + return 0; ldns_buffer_skip(query, LDNS_HEADER_SIZE); m->qname = ldns_buffer_current(query); if((m->qname_len = query_dname_len(query)) == 0)