BUG/MEDIUM: mux-h2: Fix dfl calculation when merging CONTINUATION frames
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 21 Apr 2021 09:11:21 +0000 (11:11 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Apr 2021 09:10:53 +0000 (11:10 +0200)
commitbbdf339b4ad4982f99939dd2b34b11e5e77086a9
tree0cd7283a3011deeb7d592676028b9ae6717ec3f3
parent393d087228688f487cf433a49bae5bf1551bd556
BUG/MEDIUM: mux-h2: Fix dfl calculation when merging CONTINUATION frames

When header are splitted over several frames, payload of HEADERS and
CONTINUATION frames are merged to form a unique HEADERS frame before
decoding the payload. To do so, info about the current frame are updated
(dff, dfl..) with info of the next one. Here there is a bug when the frame
length (dfl) is update. We must add the next frame length (hdr.dfl) and not
only the amount of data found in the buffer (clen). Because HEADERS frames
are decoded in one pass, dfl value is the whole frame length or 0. nothing
intermediary.

This patch must be backported as far as 2.0.

(cherry picked from commit cb1847c77285ba6dbd413774fcf2282cafa19bd2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 55c007ae42cd210506b0d6e99c13238c4ea49d19)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 081474a3ac01871eafdcfbe59df418d52e1ebd16)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/mux_h2.c