From: Christopher Faulet Date: Mon, 21 Sep 2020 09:59:21 +0000 (+0200) Subject: BUG/MINOR: mux-h1: Be sure to only set CO_RFL_READ_ONCE for the first read X-Git-Tag: v2.3-dev6~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69f2cb8df386cc5eee19f7d51da32570cbc1efe8;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux-h1: Be sure to only set CO_RFL_READ_ONCE for the first read The condition to set CO_RFL_READ_ONCE flag is not really accurate. We must check the request state on frontend connection only and, in the opposite, the response state on backend connection only. Only the parsed side must be considered, not the opposite one. This patch must be backported to 2.2. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index 5d2b770234..9091159676 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2061,7 +2061,8 @@ static int h1_recv(struct h1c *h1c) b_slow_realign(&h1c->ibuf, trash.area, 0); /* avoid useless reads after first responses */ - if (h1s && (h1s->req.state == H1_MSG_RQBEFORE || h1s->res.state == H1_MSG_RPBEFORE)) + if (h1s && ((!conn_is_back(conn) && h1s->req.state == H1_MSG_RQBEFORE) || + (conn_is_back(conn) && h1s->res.state == H1_MSG_RPBEFORE))) flags |= CO_RFL_READ_ONCE; max = buf_room_for_htx_data(&h1c->ibuf);