From: Christopher Faulet Date: Wed, 2 Dec 2026 14:26:27 +0000 (+0100) Subject: BUG/MINOR: mux-fcgi: don't send the empty STDIN record twice X-Git-Tag: v3.5.0~4 X-Git-Url: https://git.kaiwu.me/http/%22..//%22%22)?a=commitdiff_plain;h=33fc3969ddd495dc18fdd15fb4a6411a2bef4017;p=haproxy.git BUG/MINOR: mux-fcgi: don't send the empty STDIN record twice In fcgi_snd_buf(), when an EOT block carrying the EOM flag was found, an empty STDIN record was sent to signal the end of the request. Then, the NOOP case was also executed because of a fallthrough. The EOM flag was tested again and a second empty STDIN record was sent. It happened when the EOT block was processed separately from the request body. The FastCGI application could then handle the second record as a protocol error. Now, EOT and NOOP blocks are handled the same way, and only one empty STDIN record is sent. No backport needed. --- diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index 6d7608db4..523c0877e 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -4362,16 +4362,9 @@ static size_t fcgi_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, break; case HTX_BLK_EOT: - if (blk->flags & HTX_BLK_FL_EOM) { - TRACE_PROTO("sending FCGI STDIN record", FCGI_EV_TX_RECORD|FCGI_EV_TX_STDIN, fconn->conn, fstrm, htx); - ret = fcgi_strm_send_empty_stdin(fconn, fstrm); - if (!ret) - goto done; - } - __fallthrough; - case HTX_BLK_NOOP: - /* Nothing is emitted for a NOOP block. But if it + /* Nothing is emitted for EOT and NOOP blocks + * (trailers are not supported). But if it * carries the EOM flag, an empty STDIN record * is sent to signal the end of the request. */