]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Disable splicing only if input data was processed
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 3 Jul 2020 13:12:00 +0000 (15:12 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 Jul 2020 12:29:18 +0000 (14:29 +0200)
In h1_rcv_buf(), the splicing is systematically disabled if it was previously
enabled. When it happens, if the splicing is enabled it means the channel's
buffer was empty before calling h1_rcv_buf(). Thus, the only reason to disable
the splicing at this step is when some input data have just been processed.

This patch may be backported to 2.1 and 2.0.

src/mux_h1.c

index 7aa448c2b6afa88ab4dd881491a04c579c76f766..97f0a22be53422e751e18ec76d9cee6d8ef1e469 100644 (file)
@@ -2688,7 +2688,7 @@ static size_t h1_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
                }
        }
        else {
-               if (h1s->flags & H1S_F_SPLICED_DATA) {
+               if (ret && h1s->flags & H1S_F_SPLICED_DATA) {
                        h1s->flags &= ~H1S_F_SPLICED_DATA;
                        TRACE_STATE("disable splicing", H1_EV_STRM_RECV, h1c->conn, h1s);
                }