]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: conn-stream: Rely on endpoint shutdown flags to shutdown an applet
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Apr 2022 06:50:00 +0000 (08:50 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 Apr 2022 12:14:27 +0000 (14:14 +0200)
cs_applet_shut() now relies on CS_EP_SH* flags to performed the applet
shutdown. It means the applet release callback is called if there is no
CS_EP_SHR or CS_EP_SHW flags set. And it set these flags, CS_EP_SHRR and
CS_EP_SHWN more specifically, before exiting.

This way, cs_applet_shut() is the really equivalent to cs_conn_shut().

src/conn_stream.c

index c721083ac3bc31ce42dbed5d460262bd347348a7..29bf49b050511463d3f2be0847615936709b6b14 100644 (file)
@@ -476,8 +476,13 @@ void cs_applet_shut(struct conn_stream *cs)
 {
        struct appctx *appctx = __cs_appctx(cs);
 
-       if (appctx->applet->release && !cs_state_in(cs->state, CS_SB_DIS|CS_SB_CLO))
+       if (cs->endp->flags & (CS_EP_SHR|CS_EP_SHW))
+               return;
+
+       if (appctx->applet->release)
                appctx->applet->release(appctx);
+
+       cs->endp->flags |= CS_EP_SHRR | CS_EP_SHWN;
 }
 
 /*