general: several optimizations

This commit is contained in:
nadoo committed 2020-08-25 22:14:08 +08:00
1 parent f65a983da8
commit 167e6e5d29
14 files changed
+85 -104

No files matched your search

+2 -2
View File
@@ -87,11 +87,11 @@ func (s *UDPTun) ListenAndServe() {
nm.Store(raddr.String(), pc)
go func() {
go func(c, pc net.PacketConn, raddr net.Addr) {
conn.RelayUDP(c, raddr, pc, 2*time.Minute)
pc.Close()
nm.Delete(raddr.String())
}()
}(c, pc, raddr)
} else {
pc = v.(net.PacketConn)