mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-19 15:14:56 +08:00
optimize tcp relay
This commit is contained in:
@@ -55,7 +55,6 @@ func (h *tcpHandler) relay(localConn, remoteConn net.Conn) {
|
|||||||
closeOnce()
|
closeOnce()
|
||||||
} else {
|
} else {
|
||||||
localConn.SetDeadline(time.Now())
|
localConn.SetDeadline(time.Now())
|
||||||
remoteConn.SetDeadline(time.Now())
|
|
||||||
tcpCloseRead(remoteConn)
|
tcpCloseRead(remoteConn)
|
||||||
}
|
}
|
||||||
wg.Done()
|
wg.Done()
|
||||||
@@ -66,7 +65,6 @@ func (h *tcpHandler) relay(localConn, remoteConn net.Conn) {
|
|||||||
closeOnce()
|
closeOnce()
|
||||||
} else {
|
} else {
|
||||||
localConn.SetDeadline(time.Now())
|
localConn.SetDeadline(time.Now())
|
||||||
remoteConn.SetDeadline(time.Now())
|
|
||||||
tcpCloseRead(localConn)
|
tcpCloseRead(localConn)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user