BUG/MEDIUM: stconn: Don't forward shutdown to SE if iobuf is not empty
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 2 Apr 2024 16:01:23 +0000 (18:01 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Apr 2024 06:46:37 +0000 (08:46 +0200)
commit3abf6934a436a6fba14a44145c020663c81ef29d
treee0f934c4e68654ac652dc4d3d4c38ef130fa9c29
parenta305bb92b990e505b9cc08ba6c5f2aab1649135b
BUG/MEDIUM: stconn: Don't forward shutdown to SE if iobuf is not empty

It is only an issue when the kernel splicing is used. The zero-copy
forwarding via the buffers is not affected. When a shutdown is received on
the producer side and some data are blocked in the pipe for a while, the
shutdown may be forwarded to the other side. Usually, in this case, the
shutdown must be scheduled, waiting all output data (from the channel and
the consumer's iobuf) are sent. But only the channel was considered.

The bug was introduced by commit 20c463955d ("MEDIUM: channel: don't look at
iobuf to report an empty channel"). To fix the issue, we must also check
data blocked in the consummer iobuf.

This patch should solve the issue #2505. It must be backported to 2.9.
src/stconn.c
src/stream.c