]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Attempt for auth zone fix; add of callback in mesh gets from
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 23 Apr 2018 12:51:00 +0000 (12:51 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 23 Apr 2018 12:51:00 +0000 (12:51 +0000)
  callback does not skip callback of result.

git-svn-id: file:///svn/unbound/trunk@4647 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
services/mesh.c

index 7b5ed7ea84390779da89abcf58090972f011b339..2e2e207290071d896376893f038a36d9d1364de6 100644 (file)
@@ -5,6 +5,8 @@
        - auth zone http download stores exact copy of downloaded file,
          including comments in the file.
        - Fix sldns parse failure for CDS alternate delete syntax empty hex.
+       - Attempt for auth zone fix; add of callback in mesh gets from
+         callback does not skip callback of result.
 
 20 April 2018: Wouter
        - man page documentation for dns-over-tls forward-addr '#' notation.
index 3395dc62e67499d48c6bd9e9c7369051cc08c1f3..08e537c5f874f6afd0c3aaa07e351cf0fca36216 100644 (file)
@@ -736,7 +736,8 @@ mesh_state_cleanup(struct mesh_state* mstate)
                        comm_point_drop_reply(&rep->query_reply);
                        mesh->num_reply_addrs--;
                }
-               for(cb=mstate->cb_list; cb; cb=cb->next) {
+               while((cb = mstate->cb_list)!=NULL) {
+                       mstate->cb_list = cb->next;
                        fptr_ok(fptr_whitelist_mesh_cb(cb->cb));
                        (*cb->cb)(cb->cb_arg, LDNS_RCODE_SERVFAIL, NULL,
                                sec_status_unchecked, NULL);
@@ -1167,7 +1168,13 @@ void mesh_query_done(struct mesh_state* mstate)
                }
        }
        mstate->replies_sent = 1;
-       for(c = mstate->cb_list; c; c = c->next) {
+       while((c = mstate->cb_list) != NULL) {
+               /* take this cb off the list; so that the list can be
+                * changed, eg. by adds from the callback routine */
+               mstate->cb_list = c->next;
+               if(!mstate->reply_list && !mstate->cb_list &&
+                       mstate->super_set.count == 0)
+                       mstate->s.env->mesh->num_detached_states++;
                mesh_do_callback(mstate, mstate->s.return_rcode, rep, c);
        }
 }