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.
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.
*/