]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-h1: Properly handle empty message when an error is triggered
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 3 Sep 2024 12:10:29 +0000 (14:10 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 3 Sep 2024 12:28:42 +0000 (14:28 +0200)
commit0d4271cdae18780de79e1ce997d562f91eeee316
treed9b644b296a137094d8c7d80b17849569aa0e743
parent15a737eb5fc54bbc8aa5cadad054a69badde5b8e
BUG/MEDIUM: mux-h1: Properly handle empty message when an error is triggered

When a 400/408/500/501 error is returned by the H1 multiplexer, we first try
to get the error message of the proxy before using the default one. This may
be configured to be mapped on /dev/null or on an empty file. In that case,
no message is emitted, as expected. But everything is handled as the error
was successfully sent.

However, there is an bug here. In h1_send_error() function, this case is not
properly handled. The flag H1C_F_ABRTED is not set on the H1 connection as it
should be and h1_close() function is not called, leaving the H1 connection in an
undefined state.

It is especially an issue when a "empty" 408-Request-Time-out error is emitted
while there are data blocked in the output buffer. In that case, the connection
remains openned until the client closes and a "cR--"/408 is logged repeatedly, every
time the client timeout is reached.

This patch must backported as far as 2.8.
src/mux_h1.c