]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: backend: fix the conn_retries check for TFO
authorWilly Tarreau <w@1wt.eu>
Wed, 31 Dec 2025 11:32:21 +0000 (12:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 31 Dec 2025 12:03:53 +0000 (13:03 +0100)
In 2.6, the retries counter on a stream was changed from retries left
to retries done via commit 731c8e6cf ("MINOR: stream: Simplify retries
counter calculation"). However, one comparison fell through the cracks
in order to detect whether or not we can use TFO (only first attempt),
resulting in TFO never working anymore.

This may be backported to all versions till 2.6.

src/backend.c

index 587e3e7c0b1eece17d506d0ac10b3b17e4904327..b13922d656d3f00dbe7e5e512c0620156e51c631 100644 (file)
@@ -1447,7 +1447,7 @@ static int do_connect_server(struct stream *s, struct connection *conn)
 
        if (co_data(&s->res))
                conn_flags |= CONNECT_HAS_DATA;
-       if (s->conn_retries == s->max_retries)
+       if (s->conn_retries == 0)
                conn_flags |= CONNECT_CAN_USE_TFO;
        if (!conn_ctrl_ready(conn) || !conn_xprt_ready(conn)) {
                ret = conn->ctrl->connect(conn, conn_flags);