]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: h2: don't close after the first DATA frame on tunnelled responses
authorWilly Tarreau <w@1wt.eu>
Thu, 14 Dec 2017 09:55:21 +0000 (10:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Dec 2017 12:43:52 +0000 (13:43 +0100)
commit13e4e94dae3e51b4076085fdac395a1d71e26ac1
tree37249d05623cf1642d30ad5f3eefbc55b15a4d39
parentc4134ba8b0dacfe008a7974a8d31630534030ca7
BUG/MEDIUM: h2: don't close after the first DATA frame on tunnelled responses

Tunnelled responses are those without a content-length nor a chunked
encoding. They are specially dealt with in the current code but the
behaviour is not correct. The fact that the chunk size is left to zero
with a state artificially set to CHUNK_SIZE validates the test on
whether or not to set the end of stream flag. Thus the first DATA
frame always carries the ES flag and subsequent ones remain blocked.

This patch fixes it in two ways :
  - update h1m->curr_len to the size of the current buffer so that it
    is properly subtracted later to find the real end ;
  - don't set the state to CHUNK_SIZE when there's no content-length
    and instead set it to CHUNK_SIZE only when there's chunking.

This fix needs to be backported to 1.8.
src/mux_h2.c