From 8e07407486d6c376f94d9069a3ba67185ae76c91 Mon Sep 17 00:00:00 2001 From: Shilmoon <62980108+Shilmoon@users.noreply.github.com> Date: Thu, 19 Nov 2026 13:54:02 +0100 Subject: [PATCH] XHTTP/3 client: Close the UDP socket when the QUIC dial fails (#7413) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/XTLS/Xray-core/pull/7413#pullrequestreview-5975182281 --------- Co-authored-by: Claude Fable 5.2 Co-authored-by: 风扇滑翔翼 --- transport/internet/splithttp/dialer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/transport/internet/splithttp/dialer.go b/transport/internet/splithttp/dialer.go index b52f5a71d..95b1695ea 100644 --- a/transport/internet/splithttp/dialer.go +++ b/transport/internet/splithttp/dialer.go @@ -227,6 +227,9 @@ func createHTTPClient(dest net.Destination, streamSettings *internet.MemoryStrea conn, err := tr.DialEarly(ctx, udpAddr, tlsCfg, cfg) if err != nil { + // pktConn first: tr.Close() waits for the read from it to return, which with dialerProxy has no deadline + pktConn.Close() + tr.Close() return nil, err } context.AfterFunc(conn.Context(), func() { tr.Close(); pktConn.Close() })