]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-spop: Truly drain outgoing data when the stream is closed
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 Jun 2026 15:14:23 +0000 (17:14 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 Jun 2026 18:51:41 +0000 (20:51 +0200)
After the H2 and the FCGI multiplexers, it is the third mux concerned by
this issue.

When we try to send data to the server and the stream is closed (in error,
in half-closed state or fully closed), remaining data must be drained. This
way the upper stream is able to properly handle the stream close.

However, there was a bug here. The mux claimed to have consumed these data
without draining them from the buffer. The issue was never reported on the
SPOP multiplexer. But, in theory, the same than for the FCGI multiplexer is
possible.

This patch must be backported as far as 3.2.

src/mux_spop.c

index 840fa3c9f0d8fb4f2462b648c0f007ca7506982a..3a921ca4e75be906b457392cd36f08e81ca61a34 100644 (file)
@@ -3427,6 +3427,7 @@ static size_t spop_snd_buf(struct stconn *sc, struct buffer *buf, size_t count,
 
        if (spop_strm->state >= SPOP_SS_HLOC) {
                /* trim any possibly pending data after we close */
+               b_del(buf, count);
                total += count;
                count = 0;
        }