diff --git a/doc/Changelog b/doc/Changelog index ff3810b9d..197e4b29b 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +29 June 2020: Wouter + - Move reply list clean for serve expired mesh callback to after + the reply is sent, so that script callbacks have reply_info. + 24 June 2020: Wouter - iana portlist updated. - doxygen file comments for dynlibmodule. diff --git a/services/mesh.c b/services/mesh.c index 4bc4341c4..223414415 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -1959,14 +1959,6 @@ mesh_serve_expired_callback(void* arg) log_dns_msg("Serve expired lookup", &qstate->qinfo, msg->rep); r = mstate->reply_list; - mstate->reply_list = NULL; - if(!mstate->reply_list && !mstate->cb_list && r) { - log_assert(mesh->num_reply_states > 0); - mesh->num_reply_states--; - if(mstate->super_set.count == 0) { - mesh->num_detached_states++; - } - } for(; r; r = r->next) { /* If address info is returned, it means the action should be an * 'inform' variant and the information should be logged. */ @@ -2000,6 +1992,14 @@ mesh_serve_expired_callback(void* arg) mesh->ans_expired++; } + mstate->reply_list = NULL; + if(!mstate->reply_list && !mstate->cb_list && r) { + log_assert(mesh->num_reply_states > 0); + mesh->num_reply_states--; + if(mstate->super_set.count == 0) { + mesh->num_detached_states++; + } + } 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 */