mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-28 08:30:46 +00:00
BUG/MEDIUM: mux-fcgi: Properly handle EOM flag on end-of-trailers HTX block
Trailers are skipped by the FCGI multiplexer. However empty chunked messages are not properly handled. It may be a chunked H1 request with no payload or a H2/H3 POST request with no payload. In that caes, the EOT HTX block is just ignored. The issue is that the EOM flag is thus ignored too. It means no empty STDIN record is sent to mark the end of the request to the server. To fix the issue, when a EOT htx block is found and it is the last HTX block of the message (and it should be), the EOM flag is tested. If it is found, an empty STDIN record is emitted. This patch should fix the issue #2499. It must be backported as far as 2.4.
This commit is contained in:
parent
bd384a359b
commit
56c4b29ff1
@ -4043,6 +4043,15 @@ static size_t fcgi_snd_buf(struct stconn *sc, struct buffer *buf, size_t count,
|
||||
}
|
||||
break;
|
||||
|
||||
case HTX_BLK_EOT:
|
||||
if (htx_is_unique_blk(htx, blk) && (htx->flags & HTX_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;
|
||||
|
||||
default:
|
||||
remove_blk:
|
||||
htx_remove_blk(htx, blk);
|
||||
|
Loading…
Reference in New Issue
Block a user