]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: applet: Commit changes into input buffer after sending HTX data
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Jun 2026 13:16:35 +0000 (15:16 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Jun 2026 13:39:43 +0000 (15:39 +0200)
After sending HTX data to an applet, htx_to_buf() must be called on the
applet buffer to commit changes (and possibly to reset the buffer if it is
empty). This was performed on the output buffer while it should in fact be
performed on the input buffer. So let's fix it.

This patch must be backported as far as 3.0.

src/applet.c

index d93720ec9c95ffa5dd164952e88697952aaf8546..6e51884046b02c930016d5acbd3c3f993d9a6b1b 100644 (file)
@@ -611,7 +611,7 @@ size_t appctx_htx_snd_buf(struct appctx *appctx, struct buffer *buf, size_t coun
                appctx_htx->flags |= (buf_htx->flags & HTX_FL_EOM);
        }
 
-       htx_to_buf(appctx_htx, &appctx->outbuf);
+       htx_to_buf(appctx_htx, &appctx->inbuf);
        htx_to_buf(buf_htx, buf);
        ret -= buf_htx->data;
 end: