]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: applet: Fix HTX .rcv_buf callback function to release outbuf buffer
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 26 Feb 2024 15:34:43 +0000 (16:34 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 26 Feb 2024 15:40:13 +0000 (16:40 +0100)
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

index 615cf3ef09cd3e95780640598682099723a002da..21f61b04368efaa474938717f5ff2f690ec9978d 100644 (file)
@@ -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: