]> git.kaiwu.me - haproxy.git/commit
MINOR: h1: indicate the trailers state to h1_parse_msg_tlrs()
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Nov 2026 17:49:11 +0000 (18:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Nov 2026 21:45:32 +0000 (22:45 +0100)
commite8399b5fd5628b53d4c2e138c7d67ac00b50e169
tree4064d327e39d3d22e4e3d0cfdff175f6e87c506d
parent48d3fcd7d67ab0325f81bd71016f314bb2370706
MINOR: h1: indicate the trailers state to h1_parse_msg_tlrs()

In order to parse H1 trailers, h1_parse_msg_tlrs() builds a local dummy
h1m that sets H1_MF_HDRS_ONLY and calls h1_headers_to_hdr_list() which
directly jumps to plain headers parsing. However, this latter function
has no way to adjust its error processing on header or trailer because
the information regarding the fact that headers or trailers are being
parsed isn't present. Currently this is not a problem but it will become
in order to refine error processing to have separate rules for headers
and trailers.

This patch sets the dummy h1m's state to H1_MSG_TRAILERS so that the
called function can safely rely on it. All other callers pass a real
message with a valid state, so it will be possible to check h1m->state
during error processing to figure if the function is in the process of
parsing trailers or headers.
src/h1_htx.c