MINOR: conn-stream: Rely on endpoint shutdown flags to shutdown an applet
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().
diff --git a/src/conn_stream.c b/src/conn_stream.c
index c721083..29bf49b 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -476,8 +476,13 @@
{
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;
}
/*