MEDIUM: mux_h1: release idling frontend conns on soft-stop

In h1_process, if the proxy of a frontend connection is disabled,
release the connection.

This commit is in preparation to properly close idling front connections
on soft-stop. h1_process must still be called, this will be done via a
dedicated task which monitors the global variable stopping.
This commit is contained in:
Amaury Denoyelle 2021-05-05 11:11:11 +02:00
parent 99cca08ecc
commit efc6e95642

View File

@ -2769,6 +2769,15 @@ static int h1_process(struct h1c * h1c)
if (!b_data(&h1c->ibuf))
h1_release_buf(h1c, &h1c->ibuf);
/* Check if a soft-stop is in progress.
* Release idling front connection if this is the case.
*/
if (!(h1c->flags & H1C_F_IS_BACK)) {
if (unlikely(h1c->px->disabled)) {
if (h1c->flags & H1C_F_WAIT_NEXT_REQ)
goto release;
}
}
if ((h1c->flags & H1C_F_WANT_SPLICE) && !h1s_data_pending(h1s)) {
TRACE_DEVEL("xprt rcv_buf blocked (want_splice), notify h1s for recv", H1_EV_H1C_RECV, h1c->conn);