From: Christopher Faulet Date: Fri, 3 Jul 2020 13:02:25 +0000 (+0200) Subject: BUG/MINOR: mux-h1: Don't read data from a pipe if the mux is unable to receive X-Git-Tag: v2.2.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0060be9ccfc76f8c6a9c29ce99d18a37d85bcc1d;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux-h1: Don't read data from a pipe if the mux is unable to receive In h1_rcv_pipe(), if the mux is unable to receive data, for instance because the multiplexer is blocked on input waiting the other side (BUSY mode), no receive must be performed. This patch must be backported to 2.1 and 2.0. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index a6dffeb09d..7aa448c2b6 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2781,6 +2781,12 @@ static int h1_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned int c h1s->flags &= ~H1S_F_BUF_FLUSH; h1s->flags |= H1S_F_SPLICED_DATA; TRACE_STATE("enable splicing", H1_EV_STRM_RECV, cs->conn, h1s); + + if (!h1_recv_allowed(h1s->h1c)) { + TRACE_DEVEL("leaving on !recv_allowed", H1_EV_STRM_RECV, cs->conn, h1s); + goto end; + } + if (h1m->state == H1_MSG_DATA && count > h1m->curr_len) count = h1m->curr_len; ret = cs->conn->xprt->rcv_pipe(cs->conn, cs->conn->xprt_ctx, pipe, count);