]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: mux-h1: Remove unneeded null check
authorEgor Shestakov <egor@ved1.me>
Wed, 18 Feb 2026 14:43:30 +0000 (14:43 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 19 Feb 2026 07:20:37 +0000 (08:20 +0100)
Since 3.1 a task is always created when H1 connections initialize, so
the later null check before task_queue() became unneeded.

Could be backported with 3c09b3432 (BUG/MEDIUM: mux-h1: Fix how timeouts
are applied on H1 connections).

src/mux_h1.c

index bdb461237f3f3cb11ccbb23937a8b7d69a2c85b2..430ff0da1e8a3d01dfafae12372499b9b4df1f6e 100644 (file)
@@ -1371,11 +1371,9 @@ static int h1_init(struct connection *conn, struct proxy *proxy, struct session
                            H1_EV_H1C_NEW|H1_EV_STRM_NEW, h1c->conn, h1c->h1s);
        }
 
-       if (t) {
-               h1_set_idle_expiration(h1c);
-               t->expire = tick_first(t->expire, h1c->idle_exp);
-               task_queue(t);
-       }
+       h1_set_idle_expiration(h1c);
+       t->expire = tick_first(t->expire, h1c->idle_exp);
+       task_queue(t);
 
        /* prepare to read something */
        if (b_data(&h1c->ibuf))