]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: haterm: fix the response body phase on short writes
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 4 Nov 2026 15:14:28 +0000 (16:14 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 4 Nov 2026 15:30:23 +0000 (16:30 +0100)
commitf7a42a4129211e4f6928a60c78f4bbef253ffdd5
treec15c60927bafe8ed7489d5f02fde2013bbc4e8e6
parentd341fd3ee64762486c292609815433063218c218
BUG/MINOR: haterm: fix the response body phase on short writes

hstream_add_ff_data() computed the offset of the next body byte as
(req_size - len) % modulo, where <len> is the length offered by the mux
for that call. A short write or a partially filled output buffer makes it
smaller than the number of bytes still to send, so the offset no longer
matched what had already been emitted: the repeating pattern jumped and
the peer received a corrupted body, which happened as soon as a proxy read
the response with its own buffer boundaries. Use hs->to_write instead.

Introduced with ecf36f2ca ("MEDIUM: haterm: Add support for 0-copy data
forwading and option to disable it"), present only in the development
branch, so no backport is needed.
src/haterm.c