]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-fcgi: Properly handle read0 on partial records
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Jan 2025 14:18:14 +0000 (15:18 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 3 Feb 2025 06:49:50 +0000 (07:49 +0100)
commit5f927f603aae4614f82c73ff6c2e3324ecfdf506
tree98b2e530bfb05a768baa0705c557a3c5c33e30ff
parent0a28b1ea0c674f7bcc7ad386abdcf963f9176475
BUG/MEDIUM: mux-fcgi: Properly handle read0 on partial records

A Read0 event could be ignored by the FCGI multiplexer if it is blocked on a
partial record. Instead of handling the event, it remained blocked, waiting
for the end of the record.

To fix the issue, the same solution than the H2 multiplexer is used. Two
flags are introduced. The first one, FCGI_CF_END_REACHED, is used to
acknowledge a read0. This flag is set when a read0 was received AND the FCGI
multiplexer must handle it. The second one, FCGI_CF_DEM_SHORT_READ, is set
when the demux is interrupted on a partial record. A short read and a read0
lead to set the FCGI_CF_END_REACHED flag.

With these changes, the FCGI mux should be able to properly handle read0 on
partial records.

This patch should be backported to all stable versions after a period of
observation.
include/haproxy/mux_fcgi-t.h
src/mux_fcgi.c