BUG/MINOR: mux-fcgi: Handle empty STDERR record
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 15 Jul 2020 13:46:30 +0000 (15:46 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 17 Jul 2020 08:27:53 +0000 (10:27 +0200)
commit928cf5a4fdb894a91831fee2ba3469b274f9ad30
treee5701dcaca24fc94622fb05cdd591cca795d22e8
parentcd12873354da09aead5c953a778a895b3ddc8823
BUG/MINOR: mux-fcgi: Handle empty STDERR record

As mentionned in the FastCGI specification, FCGI "streams" are series of
non-empty stream records (length != 0), followed by an empty one. It is properly
handled for FCGI_STDOUT records, but not for FCGI_STDERR ones. If an empty
FCGI_STDERR record is received, the connection is blocked waiting for data which
will never come.

To fix the bug, when an empty FCGI_STDERR record is received, we drop it, eating
the padding if any.

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

(cherry picked from commit 7f85433a912529c5cda1629001b34fd2b2e54758)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit bd6dc07038f4c6b552559ccde41d31ff9a7dbf6d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/mux_fcgi.c