From 69f2cb8df386cc5eee19f7d51da32570cbc1efe8 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 21 Sep 2020 11:59:21 +0200 Subject: [PATCH] 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. --- src/mux_h1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.47.3