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 08:02:00 +0000 (10:02 +0200)
commit6670e3e2bf64d4273c164cd5a70bb9acde2820b2
tree8cc944f4312ff4db0e2038d05f1897cc59be2e66
parent08eb718494803fc389c3b729bc230ceb045ebea7
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.
src/mux_fcgi.c