From: Wouter Wijngaards Date: Mon, 23 Apr 2018 12:51:00 +0000 (+0000) Subject: - Attempt for auth zone fix; add of callback in mesh gets from X-Git-Tag: release-1.7.1rc1~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=deea985a20dcc66851aeb8e1cf1d9cdf3a6a3401;p=thirdparty%2Funbound.git - Attempt for auth zone fix; add of callback in mesh gets from callback does not skip callback of result. git-svn-id: file:///svn/unbound/trunk@4647 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 7b5ed7ea8..2e2e20729 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/services/mesh.c b/services/mesh.c index 3395dc62e..08e537c5f 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -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); } }