]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: applet: Add a flag to state an applet is using zero-copy forwarding
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 12 Feb 2024 21:13:23 +0000 (22:13 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 14 Feb 2024 13:22:36 +0000 (14:22 +0100)
commitece002af1db63e5e0e5d48e903c7d75ef618bd49
treedc8a9b598953b3bd400af2edf8fbe0ab4e75649d
parent1465eb570b239f99e4b56beed9b0189b011ead45
BUG/MEDIUM: applet: Add a flag to state an applet is using zero-copy forwarding

An issue was introduced when zero-copy forwarding was added to the stats and
cache applets. There is no test to be sure the upper layer is ready to use
the zero-copy forwarding. So these applets refuse to deliver the response
into the applet's output buffer if the zero-copy forwarding is supported by
the opposite endpoint. It is especially an issue when a filter, like the
compression, is in-use on the response channel.

Because of this bug, the response is not delivered and the applet is woken
up in loop to produce data.

To fix the issue, an appctx flag was added, APPCTX_FL_FASTFWD, to know when
the zero-copy forwarding is in-use. We rely on this flag to not fill the
outbuf in the applet's I/O handler.

No backport needed.
include/haproxy/applet-t.h
src/applet.c
src/cache.c
src/stats.c