BUG/MEDIUM: h1: Properly reset h1m flags when headers parsing is restarted
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Dec 2021 17:01:48 +0000 (18:01 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 2 Dec 2021 14:10:45 +0000 (15:10 +0100)
commit98dd6816dfc352fe6d7b019147b0b363a859e37a
tree03735f30ea7742e9af46cea9848f210e3bbee9f8
parente58cefb519056c2299b1b14c9e598c312c65848f
BUG/MEDIUM: h1: Properly reset h1m flags when headers parsing is restarted

If H1 headers are not fully received at once, the parsing is restarted a
last time when all headers are finally received. When this happens, the h1m
flags are sanitized to remove all value set during parsing.

But some flags where erroneously preserved. Among others, H1_MF_TE_CHUNKED
flag was not removed, what could lead to parsing error.

To fix the bug and make things easy, a mask has been added with all flags
that must be preserved. It will be more stable. This mask is used to
sanitize h1m flags.

This patch should fix the issue #1469. It must be backported to 2.5.

(cherry picked from commit 02c893332bb22b49dbc96e804ca6018446c40f7c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/h1.h
src/h1.c