mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-11-20 16:49:12 +00:00
XHTTP/3 client: Close the UDP socket when the QUIC dial fails (#7413)
https://github.com/XTLS/Xray-core/pull/7413#pullrequestreview-5975182281 --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
This commit is contained in:
co-authored by
Claude Fable 5.2
风扇滑翔翼
parent
febc082f03
commit
8e07407486
@@ -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() })
|
||||
|
||||
Reference in New Issue
Block a user