From: Christopher Faulet Date: Tue, 7 Jul 2020 08:56:40 +0000 (+0200) Subject: BUG/MEDIUM: mux-h1: Disable splicing for the conn-stream if read0 is received X-Git-Tag: v2.2.0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a131a8fe934b40324fd8a16d237616331ea0088f;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: mux-h1: Disable splicing for the conn-stream if read0 is received The CS_FL_MAY_SPLICE flag must be unset for the conn-stream if a read0 is received while reading on the kernel pipe. It is mandatory when some data was also received. Otherwise, this flag prevent the call to the h1 rcv_buf() callback. Thus the read0 will never be handled by the h1 multiplexer leading to a freeze of the session until a timeout is reached. This patch must be backported to 2.1 and 2.0. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index 97f0a22be5..8f3222ddf3 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2805,7 +2805,8 @@ static int h1_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned int c TRACE_STATE("read0 on connection", H1_EV_STRM_RECV, cs->conn, h1s); } - if ((h1m->state != H1_MSG_TUNNEL && h1m->state != H1_MSG_DATA) || + if ((h1s->flags & H1S_F_REOS) || + (h1m->state != H1_MSG_TUNNEL && h1m->state != H1_MSG_DATA) || (h1m->state == H1_MSG_DATA && !h1m->curr_len)) cs->flags &= ~CS_FL_MAY_SPLICE;