]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
multiple subrequests at the same time.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 30 May 2007 14:55:40 +0000 (14:55 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 30 May 2007 14:55:40 +0000 (14:55 +0000)
git-svn-id: file:///svn/unbound/trunk@351 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c
doc/Changelog

index 985a73ef7b84c9db86c8d3d1f8a0f08952aaee36..78ef5d0a0c3be4491e787794d8d773d841f4876c 100644 (file)
@@ -169,6 +169,33 @@ set_extstates_initial(struct worker* worker, struct module_qstate* qstate)
                qstate->ext_state[i] = module_state_initial;
 }
 
+/** find runnable recursive */
+static struct module_qstate*
+find_run_in(struct module_qstate* p)
+{
+       struct module_qstate* q;
+       for(p = p->subquery_first; p; p = p->subquery_next) {
+               if(p->ext_state[p->curmod] == module_state_initial)
+                       return p;
+               if((q=find_run_in(p)))
+                       return q;
+       }
+       return NULL;
+}
+
+/** find other runnable subqueries */
+static struct module_qstate*
+find_runnable(struct module_qstate* subq)
+{
+       struct module_qstate* p = subq;
+       if(p->subquery_next && p->subquery_next->ext_state[
+               p->subquery_next->curmod] == module_state_initial)
+               return p->subquery_next;
+       while(p->parent)
+               p = p->parent;
+       return find_run_in(p);
+}
+
 /** process incoming request */
 static void 
 worker_process_query(struct worker* worker, struct work_query* w, 
@@ -219,6 +246,15 @@ worker_process_query(struct worker* worker, struct work_query* w,
                        event = module_event_subq_done;
                        continue;
                }
+               if(s != module_error && s != module_finished) {
+                       /* see if we can continue with other subrequests */
+                       struct module_qstate* nxt = find_runnable(qstate);
+                       if(nxt) {
+                               qstate = nxt;
+                               entry = NULL;
+                               event = module_event_pass;
+                       }
+               }
                break;
        }
        /* request done */
index 4e59aab7092f0c6c596148f30c73940200ed3225..017e685ca24e1da9865827b154457260d124f4dc 100644 (file)
@@ -9,6 +9,7 @@
        - processInitRequest and processInitRequest2.
        - cache synthesizes referral messages, with DS and NSEC.
        - processInitRequest3.
+       - if a request creates multiple subrequests these are all activated.
 
 29 May 2007: Wouter
        - routines to lock and unlock array of rrsets moved to cache/rrset.