Browse Source

fix closed session time counting

pull/15/head
Jason 5 years ago
parent
commit
31747c600f
  1. 10
      proxy/tcp.go

10
proxy/tcp.go

@ -36,8 +36,13 @@ func (h *tcpHandler) relay(localConn, remoteConn net.Conn) {
}) })
} }
// Cleanup
defer func() {
// Close // Close
defer closeOnce() closeOnce()
// Remove session
removeSession(localConn)
}()
// WaitGroup // WaitGroup
var wg sync.WaitGroup var wg sync.WaitGroup
@ -69,9 +74,6 @@ func (h *tcpHandler) relay(localConn, remoteConn net.Conn) {
pool.BufPool.Put(buf[:cap(buf)]) pool.BufPool.Put(buf[:cap(buf)])
wg.Wait() // Wait for Up Link done wg.Wait() // Wait for Up Link done
// Remove session
removeSession(localConn)
} }
func (h *tcpHandler) Handle(conn net.Conn, target *net.TCPAddr) error { func (h *tcpHandler) Handle(conn net.Conn, target *net.TCPAddr) error {

Loading…
Cancel
Save