]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: h2: support uploading partial DATA frames
authorWilly Tarreau <w@1wt.eu>
Mon, 11 Dec 2017 17:27:15 +0000 (18:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Dec 2017 12:43:52 +0000 (13:43 +0100)
commit8fc016d0fee27e2ae46bbf29b05410b78e236899
tree739d4cdd560273d42dd95c33aae89f934dded331
parent05e5dafe9a3fb2c07fc9bcb1e5c684ce2d7c4f33
BUG/MEDIUM: h2: support uploading partial DATA frames

We currently have a problem with DATA frames when they don't fit into
the destination buffer. While it was imagined that in theory this never
happens, in practice it does when "option http-buffer-request" is set,
because the headers don't leave the target buffer before trying to read
so if the frame is full, there's never enough room.

This fix consists in reading what can be read from the frame and advancing
the input buffer. Once the contents left are only the padding, the frame
is completely processed. This also solves another problem we had which is
that it was possible to fill a request buffer beyond its reserve because
the <count> argument was not respected in h2_rcv_buf(). Thus it's possible
that some POST requests sent at once with a headers+body filling exactly a
buffer could result in "400 bad req" when trying to add headers.

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