mirror of
https://github.com/go-gost/x.git
synced 2026-10-19 16:16:32 +00:00
udp.Relay.Run ignored ctx cancellation, so an idle MASQUE association (or a disconnecting client) leaked its target UDP socket and both copy goroutines, and service shutdown blocked on the stuck handlers. quic-go's ReceiveDatagram only unblocks on ctx cancellation, never on stream close, so closing the datagram conn could not release the read either. Make Relay.Run cancellation-aware and close both conns on exit, add WithReadTimeout for an idle read deadline, give DatagramConn a cancelable context that Close cancels, and apply the parsed idleTimeout to the UDP relay. Ref: https://github.com/go-gost/x/issues/128