From: Christopher Faulet Date: Wed, 15 Dec 2021 08:14:47 +0000 (+0100) Subject: MINOR: stream-int: Handle appctx case first when releasing the endpoint X-Git-Tag: v2.6-dev2~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=719ceef79c45f9b548985da5dbca41a0189808c6;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/haproxy/stream_interface.h b/include/haproxy/stream_interface.h index 88c8101d05..c1c2b03fa8 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); }