mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
Improve error handling.
git-svn-id: file:///svn/unbound/trunk@391 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
59824635da
commit
34c36a7616
3 changed files with 9 additions and 8 deletions
|
|
@ -271,17 +271,15 @@ worker_process_query(struct worker* worker, struct work_query* w,
|
||||||
"exit state is %s", strextstate(s));
|
"exit state is %s", strextstate(s));
|
||||||
if(s == module_state_initial) {
|
if(s == module_state_initial) {
|
||||||
log_err("module exit in initial state, "
|
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;
|
s = module_error;
|
||||||
}
|
}
|
||||||
/* examine results, start further modules, etc. */
|
/* examine results, start further modules, etc. */
|
||||||
if(s != module_error && s != module_finished) {
|
if(s != module_error && s != module_finished) {
|
||||||
/* see if we can continue with other subrequests */
|
/* see if we can continue with other subrequests */
|
||||||
struct module_qstate* nxt = find_runnable(qstate);
|
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) {
|
if(nxt) {
|
||||||
/* start submodule */
|
/* start submodule */
|
||||||
qstate = nxt;
|
qstate = nxt;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@
|
||||||
- when iterator moves on due to CNAME or referral, it will remove
|
- when iterator moves on due to CNAME or referral, it will remove
|
||||||
the subqueries (for other targets). These are put on the slumber
|
the subqueries (for other targets). These are put on the slumber
|
||||||
list.
|
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
|
14 June 2007: Wouter
|
||||||
- num query targets was > 0 , not >= 0 compared, so that fetch
|
- num query targets was > 0 , not >= 0 compared, so that fetch
|
||||||
|
|
|
||||||
|
|
@ -450,9 +450,9 @@ query_info_parse(struct query_info* m, ldns_buffer* query)
|
||||||
/* minimum size: header + \0 + qtype + qclass */
|
/* minimum size: header + \0 + qtype + qclass */
|
||||||
if(ldns_buffer_limit(query) < LDNS_HEADER_SIZE + 5)
|
if(ldns_buffer_limit(query) < LDNS_HEADER_SIZE + 5)
|
||||||
return 0;
|
return 0;
|
||||||
log_assert(LDNS_OPCODE_WIRE(q) == LDNS_PACKET_QUERY);
|
if(LDNS_OPCODE_WIRE(q) != LDNS_PACKET_QUERY ||
|
||||||
log_assert(LDNS_QDCOUNT(q) == 1);
|
LDNS_QDCOUNT(q) != 1 || ldns_buffer_position(query) != 0)
|
||||||
log_assert(ldns_buffer_position(query) == 0);
|
return 0;
|
||||||
ldns_buffer_skip(query, LDNS_HEADER_SIZE);
|
ldns_buffer_skip(query, LDNS_HEADER_SIZE);
|
||||||
m->qname = ldns_buffer_current(query);
|
m->qname = ldns_buffer_current(query);
|
||||||
if((m->qname_len = query_dname_len(query)) == 0)
|
if((m->qname_len = query_dname_len(query)) == 0)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue