Fix client's ListenPacket

This commit is contained in:
wwqgtxx 2023-09-22 00:17:59 +08:00 committed by 世界
parent bdcf4a07b9
commit 412455eba4
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -202,7 +202,7 @@ func (c *Client) ListenPacket(ctx context.Context) (net.PacketConn, error) {
return nil, E.New("UDP disabled by server")
}
var sessionID uint32
clientPacketConn := newUDPPacketConn(ctx, conn.quicConn, func() {
clientPacketConn := newUDPPacketConn(c.ctx, conn.quicConn, func() {
conn.udpAccess.Lock()
delete(conn.udpConnMap, sessionID)
conn.udpAccess.Unlock()