]> git.kaiwu.me - haproxy.git/commit
MEDIUM: h1: make h1_parse_chunk_size() rely on h1_parse_chunk_ext()
authorWilly Tarreau <w@1wt.eu>
Mon, 23 Nov 2026 21:14:28 +0000 (21:14 +0000)
committerWilly Tarreau <w@1wt.eu>
Tue, 24 Nov 2026 09:50:37 +0000 (10:50 +0100)
commitddac58392fe555ddeaa9986849c6cba2d5c213d8
tree66e59fb53bee0b7caab4d7a49d0ea706507ae8d2
parent6d51bbc395ca606a4a49222bacee780155a78357
MEDIUM: h1: make h1_parse_chunk_size() rely on h1_parse_chunk_ext()

h1_parse_chunk_size() is used for chunks larger than the room left in
the HTX and for lines wrapping at the buffer's end. It still had its own
lax extensions parser, which only rejected CTLs and mismatched quotes,
so that the strict syntax enforced by the contiguous parser could be
bypassed by sending a chunk larger than the buffer.

It now parses the whole line (size, extensions, CRLF) with the same
reverse index on the contiguous part of the buffer, and relies on
h1_parse_chunk_ext() for the extensions. When the line crosses the
buffer's end, the buffer is realigned in place, as is already done for
headers and trailers, and the parsing restarts. This removes the
per-byte wrapping checks of this slow path.
include/haproxy/h1.h