]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: htx/mux-h1: Properly handle bodyless responses when splicing is used
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 2 Aug 2023 07:48:55 +0000 (09:48 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 2 Aug 2023 10:05:05 +0000 (12:05 +0200)
commitef2b15998cc7148ec78c0ef6b4f511732bdf608f
treea5995f0fe4157543d413d28299de34ea0f980ad2
parentdabeb5cbd51091dd065e8615e2ad0fb07c6382a4
BUG/MINOR: htx/mux-h1: Properly handle bodyless responses when splicing is used

There is a mechanisme in the H1 and H2 multiplexer to skip the payload when
a response is returned to the client when it must not contain any payload
(response to a HEAD request or a 204/304 response). However, this does not
work when the splicing is used. The H2 multiplexer does not support the
splicing, so there is no issue. But with the mux-h1, when data are sent
using the kernel splicing, the mux on the server side is not aware the
client side should skip the payload. And once the data are put in a pipe,
there is no way to stop the sending.

It is a defect of the current design. This will be easier to deal with this
case when the mux-to-mux forwarding will be implemented. But for now, to fix
the issue, we should add an HTX flag on the start-line to pass the info from
the client side to the server side and be able to disable the splicing in
necessary.

The associated reg-test was improved to be sure it does not fail when the
splicing is configured.

This patch should be backported as far as 2.4..
include/haproxy/htx-t.h
reg-tests/http-messaging/http_bodyless_response.vtc
src/h1_htx.c
src/mux_h1.c
src/mux_h2.c