]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2: do not use timeout http-keep-alive on backend side
authorWilly Tarreau <w@1wt.eu>
Thu, 14 Apr 2022 09:43:35 +0000 (11:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Apr 2022 09:43:35 +0000 (11:43 +0200)
Commit 15a4733d5 ("BUG/MEDIUM: mux-h2: make use of http-request and
keep-alive timeouts") omitted to check the side of the connection, and
as a side effect, automatically enabled timeouts on idle backend
connections, which is totally contrary to the principle that they
must be autonomous.

This needs to be backported wherever the patch above is backported.

src/mux_h2.c

index 3b321d5e2c7e9d1e51468e8ca2cf02396d0af5f0..8cf79ae2ebcd0dbd4afdba74c0b33bd726966191 100644 (file)
@@ -722,7 +722,7 @@ static void h2c_update_timeout(struct h2c *h2c)
                } else if (br_data(h2c->mbuf)) {
                        /* pending output data: always the regular data timeout */
                        h2c->task->expire = tick_add_ifset(now_ms, h2c->timeout);
-               } else if (h2c->max_id > 0 && !b_data(&h2c->dbuf)) {
+               } else if (!(h2c->flags & H2_CF_IS_BACK) && h2c->max_id > 0 && !b_data(&h2c->dbuf)) {
                        /* idle after having seen one stream => keep-alive */
                        h2c->task->expire = tick_add_ifset(h2c->idle_start, h2c->proxy->timeout.httpka);
                        is_idle_conn = 1;