mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-02 15:16:47 +00:00
fix: quic underlay packetConn maybe not closed in masque
This commit is contained in:
1 parent
299a63f8f6
commit
96a6962b3f
1 file changed
+5
-2
@@ -268,9 +268,12 @@ func (w *Masque) run(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
var quicConn *quic.Conn
|
||||
quicConn, err = quic.Dial(ctx, pc, udpAddr, w.tlsConfig, w.quicConfig)
|
||||
transport := quic.Transport{Conn: pc}
|
||||
transport.SetCreatedConn(true) // auto close conn
|
||||
transport.SetSingleUse(true) // auto close transport
|
||||
quicConn, err := transport.Dial(ctx, udpAddr, w.tlsConfig, w.quicConfig)
|
||||
if err != nil {
|
||||
_ = pc.Close()
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user