From 25559e70554b442892cb73eaff08fee32422bd02 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Fri, 7 Nov 2025 11:24:14 +0100 Subject: [PATCH] MEDIUM: backend: Defer conn_xprt_start() after mux creation In connect_server(), defer the call to conn_xprt_start() until after we had a chance to create the mux. The xprt can behave differently depending on if a mux is or is not available at this point, as if it is, it may want to wait until some data comes from the mux. This does not need to be backported. --- src/backend.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backend.c b/src/backend.c index 9937a7f9f..c1f0ab213 100644 --- a/src/backend.c +++ b/src/backend.c @@ -2175,7 +2175,6 @@ int connect_server(struct stream *s) return SF_ERR_INTERNAL; } } - conn_xprt_start(srv_conn); /* We have to defer the mux initialization until after si_connect() * has been called, as we need the xprt to have been properly @@ -2212,6 +2211,14 @@ int connect_server(struct stream *s) } } + /* + * Now that the mux may have been created, we can start the xprt. + * We had to wait until then, because the xprt may behave differently + * depending on if a mux already exists, and it can receive data + * from the stream, or not. + */ + conn_xprt_start(srv_conn); + #if defined(HAVE_SSL_0RTT) /* The flags change below deserve some explanation: when we want to * use early data, we first want to make sure that a mux is installed -- 2.47.3