]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-h1: Fix loop if server closes its connection with unparsed data
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 11 Dec 2018 15:12:31 +0000 (16:12 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Dec 2018 16:32:15 +0000 (17:32 +0100)
commitcf56b99d0f6790c5b3ae857f4a1975fb6e06a6d7
tree257303bcc73d1d407daca692358ff19aa731b7fa
parent9a86fcbd4758181e6d37552f59bb6b896e7f0d90
BUG/MEDIUM: mux-h1: Fix loop if server closes its connection with unparsed data

A first patch was pushed to fix this bug if it happens during the headers
parsing. But it is also possible to hit the bug during the parsing of
chunks. For instance, if the server sends only part of the trailers, some data
remains unparsed. So it the server closes its connection without sending the end
of the response, we fall back again into an infinite loop.

The fix contains in 2 parts. First, we block the receive if a read0 or an error
is detected on the connection, independently if the input buffer is empty or
not. Then, the flags CS_FL_RCV_MORE and CL_FL_WANT_ROOM are always reset when
input data are processed. We set them again only when necessary.
src/mux_h1.c