From 5b750d6b330a53f96924106eddb5be4224a5fc4a Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 19 Nov 2021 13:28:17 +0100 Subject: mdssvc: consolidate calls of mds_es_search_unset_pending() Both codepaths were mds_es_search_unset_pending() is currently called end up going through the higher level callback mds_es_search_done(). Moving the call to mds_es_search_unset_pending() ensures we call it consistently and don't miss it in some error code path. Otherwise no change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14915 Signed-off-by: Ralph Boehme Reviewed-by: Noel Power --- source3/rpc_server/mdssvc/mdssvc_es.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/rpc_server') diff --git a/source3/rpc_server/mdssvc/mdssvc_es.c b/source3/rpc_server/mdssvc/mdssvc_es.c index a7a13f70c7b..cc79b42d14f 100644 --- a/source3/rpc_server/mdssvc/mdssvc_es.c +++ b/source3/rpc_server/mdssvc/mdssvc_es.c @@ -112,6 +112,7 @@ static struct tevent_req *mds_es_connect_send( static int mds_es_connect_recv(struct tevent_req *req); static void mds_es_connected(struct tevent_req *subreq); static bool mds_es_next_search_trigger(struct mds_es_ctx *mds_es_ctx); +static void mds_es_search_unset_pending(struct sl_es_search *s); static bool mds_es_connect(struct mds_ctx *mds_ctx) { @@ -440,6 +441,7 @@ static void mds_es_search_done(struct tevent_req *subreq) DBG_DEBUG("Search done for search [%p]\n", s); + mds_es_search_unset_pending(s); DLIST_REMOVE(mds_es_ctx->searches, s); ret = mds_es_search_recv(subreq); @@ -650,7 +652,6 @@ static void mds_es_search_http_send_done(struct tevent_req *subreq) } if (state->s->mds_es_ctx->mds_ctx == NULL) { - mds_es_search_unset_pending(state->s); tevent_req_error(req, ECANCELED); return; } @@ -685,8 +686,6 @@ static void mds_es_search_http_read_done(struct tevent_req *subreq) DBG_DEBUG("Got response for search [%p]\n", s); - mds_es_search_unset_pending(s); - status = http_read_response_recv(subreq, state, &state->http_response); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { -- cgit v1.2.1