]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: applet: Properly handle receives of size 0
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 May 2026 14:16:04 +0000 (16:16 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 May 2026 06:45:57 +0000 (08:45 +0200)
commit1ed4ef6659268c1b257d2640308dbd8367a31695
treeacb235b9514420c5e2f7240c1f209641e62af6d1
parent3fab21ea427dbb1dc3c45b9c3b8833dd0bc84941
BUG/MEDIUM: applet: Properly handle receives of size 0

when appctx_rcv_buf() function was called to get data from the applet, but
to get zero bytes, nothing was performed and the function early
returned. However, we must at least take care to set SE_FL_WANT_ROOM if
necessary. Otherwise, if data are still blocked in the applet's output
buffer while the EOI/EOS are pending, the information can be reported to the
upper layer and remaining data can be lost.

Indeed, in such case, SE_FL_WANT_ROOM flag is here to specify the applet has
more data to deliver. Thanks to this flag, the stream will wait before
closing. But when appctx_rcv_buf() function is called, this flag is removed by
the stconn. It is the function responsibility to set it again when necessary.

This patch should fix second part of the issue #3366. It must be backported
to 3.0.
src/applet.c