From: Amaury Denoyelle Date: Wed, 5 May 2021 09:11:11 +0000 (+0200) Subject: MEDIUM: mux_h1: release idling frontend conns on soft-stop X-Git-Tag: v2.4-dev19~147 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=efc6e95642c3546d05136b3d4712e59e042c34a8;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index e8a7d6b7a3..940b7540cb 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -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);