reverse last debug commit

This commit is contained in:
Jason
2019-08-11 15:11:06 +08:00
parent a0c52c0d37
commit d3a2debe8e
2 changed files with 0 additions and 7 deletions

View File

@@ -4,8 +4,6 @@ import (
"net" "net"
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/xjasonlyu/tun2socks/common/log"
) )
type SessionStater interface { type SessionStater interface {
@@ -58,9 +56,7 @@ func (c *SessionConn) Write(b []byte) (n int, err error) {
} }
func (c *SessionConn) Close() error { func (c *SessionConn) Close() error {
log.Warnf("sessionConn close")
if c.SessionClose.IsZero() { if c.SessionClose.IsZero() {
log.Warnf("set close time")
c.SessionClose = time.Now() c.SessionClose = time.Now()
} }
return c.Conn.Close() return c.Conn.Close()
@@ -96,9 +92,7 @@ func (c *SessionPacketConn) WriteTo(b []byte, addr net.Addr) (n int, err error)
} }
func (c *SessionPacketConn) Close() error { func (c *SessionPacketConn) Close() error {
log.Warnf("sessionConn close")
if c.SessionClose.IsZero() { if c.SessionClose.IsZero() {
log.Warnf("set close time")
c.SessionClose = time.Now() c.SessionClose = time.Now()
} }
return c.PacketConn.Close() return c.PacketConn.Close()

View File

@@ -40,7 +40,6 @@ func (h *tcpHandler) relay(localConn, remoteConn net.Conn) {
// Close // Close
defer func() { defer func() {
log.Warnf("relay close")
localConn.Close() localConn.Close()
remoteConn.Close() remoteConn.Close()
}() }()