]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: mux-h1: Account consumed output data on synchronous connection error
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 15 Sep 2022 14:21:55 +0000 (16:21 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Sep 2022 14:23:45 +0000 (16:23 +0200)
commitb0b8e9bbd2b720ed2aff469d0989ce00876007dc
tree4f07260728710da32df64a8679f36891c2712545
parent0ed617ac2ff377ce60bd9c8fd97fd9da32d43971
BUG/MINOR: mux-h1: Account consumed output data on synchronous connection error

The commit 372b38f935 ("BUG/MEDIUM: mux-h1: Handle connection error after a
synchronous send") introduced a bug. In h1_snd_buf(), consumed data are not
properly accounted if a connection error is detected. Indeed, data are
consumed when the output buffer is filled. But, on connection error, we exit
from the loop without incremented total variable accordingly.

When this happens, this leaves the channel buffer in an inconsistent
state. The buffer may be empty with some output at the channel level.
Because an error is reported, it is harmless. But it is safer to fix this
bug now to avoid any regression in future.

This patch must be backported as far as 2.2.
src/mux_h1.c