From 0060be9ccfc76f8c6a9c29ce99d18a37d85bcc1d Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 3 Jul 2020 15:02:25 +0200 Subject: [PATCH] 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. --- src/mux_h1.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.39.5