]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux_quic: make sure to always apply offsets to now_ms in expiration
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Nov 2024 14:41:21 +0000 (15:41 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Nov 2024 14:41:21 +0000 (15:41 +0100)
Now_ms can be zero nowadays, so it's not suitable for direct assignment to
t->expire, as there's a risk that the timer never wakes up once assigned
(TICK_ETERNITY). Let's use tick_add(now_ms, 0) for an immediate wakeup
instead. The impact looks nul since the task is also woken up, but better
not leave such tasks in the timer tree anyway.

This should be backported where it applies.

src/mux_quic.c

index d704403d303ff5138f9352337dbf8e6f60690e43..80f4eff2d0643b0ff750426f5c08af95819eee1d 100644 (file)
@@ -366,7 +366,7 @@ static void qcc_refresh_timeout(struct qcc *qcc)
                                        /* We are past the soft close window end, wake the timeout
                                         * task up immediately.
                                         */
-                                       qcc->task->expire = now_ms;
+                                       qcc->task->expire = tick_add(now_ms, 0);
                                        task_wakeup(qcc->task, TASK_WOKEN_TIMER);
                                }
                        }