]> git.kaiwu.me - haproxy.git/commit
OPTIM: sample: use smp_prepare_out() in the lower and upper converters
authorWilly Tarreau <w@1wt.eu>
Wed, 21 Oct 2026 21:05:05 +0000 (23:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 17 Nov 2026 10:08:46 +0000 (11:08 +0100)
commit546ddc5faafe4eb3c88a26d3d04d0be54f966582
treec39bfb6995b6d43d9a5d4b307d665e6a1b6d35e4
parent4d8d922e262264878646c2d5e9c033f28ba6317e
OPTIM: sample: use smp_prepare_out() in the lower and upper converters

These converters used to call smp_make_rw() then convert the string in
place. Most of the time their input is read-only (e.g. a header), in
which case smp_dup() first copied it into a trash chunk before the
conversion performed a second pass over it. By relying on
smp_prepare_out() instead, the converted string is directly written into
the trash chunk while reading the input, saving one pass. Writable inputs
are still converted in place.
src/sample.c