From 19559d44475b32cf24e85489ba31057c6fb6c963 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 26 Feb 2024 16:34:43 +0100 Subject: [PATCH] BUG/MEDIUM: applet: Fix HTX .rcv_buf callback function to release outbuf buffer In appctx_htx_rcv_buf(), HTX blocks found in the appctx output buffer are copied into the channel buffer. At the end, the state of the underlying buffer must be updated. If everything was copied, the buffer is reset. This way, it will be released later, at the end of the applet process function. However, here there was a typo. We do it on the input buffer instead of the output buffer. As side effect, an empty HTX message remained stuck in the appctx outbut buffer, blocking the applet and leading to blocked session with no expiration date. No backport needed. --- src/applet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applet.c b/src/applet.c index 615cf3ef0..21f61b043 100644 --- a/src/applet.c +++ b/src/applet.c @@ -506,7 +506,7 @@ size_t appctx_htx_rcv_buf(struct appctx *appctx, struct buffer *buf, size_t coun } buf_htx->extra = (appctx_htx->extra ? (appctx_htx->data + appctx_htx->extra) : 0); htx_to_buf(buf_htx, buf); - htx_to_buf(appctx_htx, &appctx->inbuf); + htx_to_buf(appctx_htx, &appctx->outbuf); ret -= appctx_htx->data; out: