mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2024-12-30 02:37:01 +00:00
fix
This commit is contained in:
+3
-4
@@ -44,7 +44,6 @@ func NewUDPHandler(proxyHost string, proxyPort uint16, timeout time.Duration, fa
|
||||
fakeDns: fakeDns,
|
||||
sessionStater: sessionStater,
|
||||
timeout: timeout,
|
||||
closed: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,13 +240,13 @@ func (h *udpHandler) ReceiveTo(conn core.UDPConn, data []byte, addr *net.UDPAddr
|
||||
}
|
||||
|
||||
func (h *udpHandler) Close(conn core.UDPConn) {
|
||||
h.Lock()
|
||||
defer h.Unlock()
|
||||
|
||||
if h.closed {
|
||||
return
|
||||
}
|
||||
|
||||
h.Lock()
|
||||
defer h.Unlock()
|
||||
|
||||
if remoteConn, ok := h.tcpConns[conn]; ok {
|
||||
remoteConn.Close()
|
||||
delete(h.tcpConns, conn)
|
||||
|
||||
Reference in New Issue
Block a user