mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-08-07 14:25:17 +03:00
Fix quic-go write leak
This commit is contained in:
@@ -78,6 +78,12 @@ func (c *Client) offerNew() (*quic.Conn, error) {
|
||||
packetConn.Close()
|
||||
return nil, err
|
||||
}
|
||||
// quic-go does not take ownership of the packet conn passed to Dial:
|
||||
// when the connection ends it only stops reading.
|
||||
go func() {
|
||||
<-quicConn.Context().Done()
|
||||
packetConn.Close()
|
||||
}()
|
||||
c.conn.Store(quicConn)
|
||||
c.rawConn = udpConn
|
||||
return quicConn, nil
|
||||
|
||||
Reference in New Issue
Block a user