]> git.kaiwu.me - haproxy.git/commit
OPTIM: haterm: use chunk builders for generated response headers
authorAleksandar Lazic <al-haproxy@none.at>
Sun, 15 Mar 2026 13:37:57 +0000 (14:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Mar 2026 06:42:33 +0000 (07:42 +0100)
commit4e57516c9a4a9e8b6b3009626dad867bb37e2609
treeb4accd90f7761db72dcc929df607682fc6641cec
parente31640368a7280aec82568f89d1f965fcc65f7cd
OPTIM: haterm: use chunk builders for generated response headers

hstream_build_http_resp() currently uses snprintf() to build the
status code and the generated X-req/X-rsp header values.

These strings are short and are fully derived from already parsed request
state, so they can be assembled directly in the HAProxy trash buffer using
`chunk_strcat()` and `ultoa_o()`.

This keeps the generated output unchanged while removing the remaining
`snprintf()` calls from the response-building path.

No functional change is expected.

Signed-off-by: Aleksandar Lazic <al-haproxy@none.at>
src/haterm.c