Browse Source

optimize socks tcp.go

pull/15/head
Jason 5 years ago
parent
commit
fc7ee875f7
  1. 6
      proxy/socks/tcp.go

6
proxy/socks/tcp.go

@ -56,8 +56,7 @@ func (h *tcpHandler) relay(localConn, remoteConn net.Conn) {
} else {
localConn.SetDeadline(time.Now())
remoteConn.SetDeadline(time.Now())
tcpCloseRead(localConn)
tcpCloseWrite(remoteConn)
tcpCloseRead(remoteConn)
}
wg.Done()
}()
@ -68,8 +67,7 @@ func (h *tcpHandler) relay(localConn, remoteConn net.Conn) {
} else {
localConn.SetDeadline(time.Now())
remoteConn.SetDeadline(time.Now())
tcpCloseRead(remoteConn)
tcpCloseWrite(localConn)
tcpCloseRead(localConn)
}
wg.Wait() // Wait for Up Link done

Loading…
Cancel
Save