]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Improve error handling.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 15 Jun 2007 12:11:44 +0000 (12:11 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 15 Jun 2007 12:11:44 +0000 (12:11 +0000)
git-svn-id: file:///svn/unbound/trunk@391 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c
doc/Changelog
util/data/msgreply.c

index b5609eb7a052d5bf69a48458c6d6c9ff52c222b9..011924fee8a443d9245d003c58213ff55373adf5 100644 (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;
index 615a2e6ee3142e04b7b261a3f7ca3b4ecaf6c7f2..475e15839c0c27da32a048500228c3faf0b51370 100644 (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
index 4b2c6e783a04b358f99cab12486a6416a1621268..b0a1f9c297ac82fccc2bd7cd9938643d18b4e2fa 100644 (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)