mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-11-27 22:18:32 +00:00
fix: quic underlay packetConn not closed in xhttp h3 mode
This commit is contained in:
1 parent
b0ea75bd21
commit
db63ffbbf6
1 file changed
+8
-2
@@ -600,7 +600,10 @@ func NewVless(option VlessOption) (*Vless, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
quicConn, err := quic.DialEarly(ctx, packetConn, udpAddr, tlsConfig, cfg)
|
||||
transport := quic.Transport{Conn: packetConn}
|
||||
transport.SetCreatedConn(true) // auto close conn
|
||||
transport.SetSingleUse(true) // auto close transport
|
||||
quicConn, err := transport.DialEarly(ctx, udpAddr, tlsConfig, cfg)
|
||||
if err != nil {
|
||||
_ = packetConn.Close()
|
||||
return nil, err
|
||||
@@ -752,7 +755,10 @@ func NewVless(option VlessOption) (*Vless, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
quicConn, err := quic.DialEarly(ctx, packetConn, udpAddr, tlsConfig, cfg)
|
||||
transport := quic.Transport{Conn: packetConn}
|
||||
transport.SetCreatedConn(true) // auto close conn
|
||||
transport.SetSingleUse(true) // auto close transport
|
||||
quicConn, err := transport.DialEarly(ctx, udpAddr, tlsConfig, cfg)
|
||||
if err != nil {
|
||||
_ = packetConn.Close()
|
||||
return nil, err
|
||||
|
||||
Reference in new issue
Block a user