3f671abfb6
The ssuHandler's connMap cached UDP forwarding connections but spawned goroutines had no context cancellation mechanism. When relayPacketUDP exited (e.g. on SS UDP session timeout), orphaned goroutines blocked indefinitely on ReadFrom, preventing connMap cleanup and leaking both goroutines and connections. Fix: derive a cancellable context in relayPacketUDP so all per-session goroutines are cancelled on exit. Add SetReadDeadline with 30s periodic timeout so goroutines can check context cancellation instead of blocking forever. Store cancel functions in a cancels sync.Map for cleanup. Fixes #821