From: Willy Tarreau Date: Wed, 31 Dec 2025 11:35:24 +0000 (+0100) Subject: BUG/MINOR: backend: inspect request not response buffer to check for TFO X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=933cb76461795cf5ca9754cd821a409d1f8dec95;p=thirdparty%2Fhaproxy.git BUG/MINOR: backend: inspect request not response buffer to check for TFO In 2.6, do_connect_server() was introduced by commit 0a4dcb65f ("MINOR: stream-int/backend: Move si_connect() in the backend scope") and changed the approach to work with a stream instead of a stream-interface. However si_oc(si) was wrongly turned to &s->res instead of &s->req, which breaks TFO by always inspecting the response channel to figure whether there are data pending. This fix can be backported to all versions till 2.6. --- diff --git a/src/backend.c b/src/backend.c index b13922d65..c8adf38a3 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1445,7 +1445,7 @@ static int do_connect_server(struct stream *s, struct connection *conn) if (unlikely(!conn || !conn->ctrl || !conn->ctrl->connect)) return SF_ERR_INTERNAL; - if (co_data(&s->res)) + if (co_data(&s->req)) conn_flags |= CONNECT_HAS_DATA; if (s->conn_retries == 0) conn_flags |= CONNECT_CAN_USE_TFO;