BUG/MEDIUM: mux-fcgi: Don't handle pending read0 too early on streams
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 8 Oct 2020 13:26:33 +0000 (15:26 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 9 Oct 2020 09:15:52 +0000 (11:15 +0200)
commit274855006edc4d6eb46e95c6187018d48741efe8
tree8c1672d1905a2224814d774afd9507733424d861
parent6eaa2f519edeeeda1a998bcb205fb553a8c22bc1
BUG/MEDIUM: mux-fcgi: Don't handle pending read0 too early on streams

A read0 received on the connection must not be handled too early by FCGI
streams. If the demux buffer is not empty, the pending read0 must not be
considered. The FCGI streams must not be passed in half-closed remote state in
fcgi_strm_wake_one_stream() and the CS_FL_EOS flag must not be set on the
associated conn-stream in fcgi_rcv_buf(). To sum up, it means, if there are
still data pending in the demux buffer, no abort must be reported to the
streams.

To fix the issue, a dedicated function has been added, responsible for detecting
pending read0 for a FCGI connection. A read0 is reported only if the demux
buffer is empty. This function is used instead of conn_xprt_read0_pending() at
some places.

This patch should fix the issue #886. It must be backported as far as 2.1.

(cherry picked from commit 6670e3e2bf64d4273c164cd5a70bb9acde2820b2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 071c3f1d68c6b1b97e5cc93a6793d4106618f9f9)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/mux_fcgi.c