BUG/MEDIUM: mux-h1: Cound data from input buf during zero-copy forwarding
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 11 Dec 2023 20:55:32 +0000 (21:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Dec 2023 08:58:22 +0000 (09:58 +0100)
commit60de35cef643ed8eb42dce5f7948231d847ec24e
treed863e839d9f262d2ccac10986c23c090b3440187
parent37ec5d7501fedcaf09dcba6f5e681faf874cc9df
BUG/MEDIUM: mux-h1: Cound data from input buf during zero-copy forwarding

During zero-copy forwarding, we first try to forward data found in the input
buffer before trying to receive more data. These data must be removed from
the amount of data to forward (the cound variable).

Otherwise, on an internal retry, in h1_fastfwd(), we can be lead to read
more data than expected. It is especially a problem on the end of a
chunk. An error is erroneously reported because more data than announced are
received.

This patch should fix the issue #2382. It must be backported to 2.9.

(cherry picked from commit eed1e8733c279cda0b6a2db574ead4e0238177f6)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/mux_h1.c