]> git.kaiwu.me - haproxy.git/commit
REGTESTS: tcp-rules: test the raw payload fetches
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Sep 2026 21:00:29 +0000 (21:00 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 15:19:30 +0000 (17:19 +0200)
commit7f8270c20fbff8931fede4afd2f304397f8aa779
tree66e66055521dd9a8eb427e8e8af4176189b4f9bf
parent79c3114db568d401364e3af873b2487514b4daea
REGTESTS: tcp-rules: test the raw payload fetches

req.len, req.payload and their "res." counterparts, the payload_lv
family and wait_end had little or no coverage. They are only usable in
TCP mode, on the raw buffers, so the test runs a plain TCP proxy and
reports what its rules see through the log.

The client sends a 4-byte big endian length, its payload and two
trailing bytes, and the server answers with the same framing, which
gives payload_lv() something to extract on both sides, including with a
relative second offset. A second client never sends enough data, which
lets the inspection delay expire so that wait_end becomes true and the
connection is rejected.

The log format ends with %B on purpose: a format made only of var()
fetches is emitted as soon as the server connection is established,
that is before the response side rules have run.
reg-tests/tcp-rules/payload.vtc [new file with mode: 0644]