From: Willy Tarreau Date: Wed, 13 Apr 2022 15:40:28 +0000 (+0200) Subject: BUG/MINOR: mux-h2: use timeout http-request as a fallback for http-keep-alive X-Git-Tag: v2.6-dev6~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86b08a3e3eb62d6642604846db3e40db37b91b16;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux-h2: use timeout http-request as a fallback for http-keep-alive The doc states that timeout http-keep-alive is not set, timeout http-request is used instead. As implemented in commit 15a4733d5 ("BUG/MEDIUM: mux-h2: make use of http-request and keep-alive timeouts"), we use http-keep-alive unconditionally between requests, with a fallback on client/server. Let's make sure http-request is always used as a fallback for http-keep-alive first. This needs to be backported wherever the commit above is backported. Thanks to Christian Ruppert for spotting this. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 8cf79ae2eb..af312c1a35 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -724,7 +724,14 @@ static void h2c_update_timeout(struct h2c *h2c) h2c->task->expire = tick_add_ifset(now_ms, h2c->timeout); } 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); + int to; + + if (tick_isset(h2c->proxy->timeout.httpka)) + to = h2c->proxy->timeout.httpka; + else + to = h2c->proxy->timeout.httpreq; + + h2c->task->expire = tick_add_ifset(h2c->idle_start, to); is_idle_conn = 1; } else { /* before first request, or started to deserialize a