Improve error handling.

git-svn-id: file:///svn/unbound/trunk@391 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-06-15 12:11:44 +00:00
parent 59824635da
commit 34c36a7616
3 changed files with 9 additions and 8 deletions

View file

@ -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;

View file

@ -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

View file

@ -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)