From 719ceef79c45f9b548985da5dbca41a0189808c6 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 15 Dec 2021 09:14:47 +0100 Subject: [PATCH] MINOR: stream-int: Handle appctx case first when releasing the endpoint Stream-interfaces will be moved in the conn-stream and the appctx will be moved at the same level than the muxes. Idea is to merge the stream-interface and the conn-stream and have a better symmetry between the muxes and the applets. To limit bugs during this refactoring, when the SI endpoint is released, the appctx case is handled first. --- include/haproxy/stream_interface.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/haproxy/stream_interface.h b/include/haproxy/stream_interface.h index 88c8101d0..c1c2b03fa 100644 --- a/include/haproxy/stream_interface.h +++ b/include/haproxy/stream_interface.h @@ -177,17 +177,17 @@ static inline void si_release_endpoint(struct stream_interface *si) if (!si->end) return; - if ((cs = objt_cs(si->end))) { + if ((appctx = objt_appctx(si->end))) { + if (appctx->applet->release && !si_state_in(si->state, SI_SB_DIS|SI_SB_CLO)) + appctx->applet->release(appctx); + appctx_free(appctx); + } + else if ((cs = objt_cs(si->end))) { if (si->wait_event.events != 0) cs->conn->mux->unsubscribe(cs, si->wait_event.events, &si->wait_event); cs_destroy(cs); } - else if ((appctx = objt_appctx(si->end))) { - if (appctx->applet->release && !si_state_in(si->state, SI_SB_DIS|SI_SB_CLO)) - appctx->applet->release(appctx); - appctx_free(appctx); - } si_detach_endpoint(si); }