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.
This commit is contained in:
Christopher Faulet 2020-09-21 11:59:21 +02:00
parent 58feb49ed2
commit 69f2cb8df3

View File

@ -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);