mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-20 15:35:45 +08:00
reverse last debug commit
This commit is contained in:
@@ -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()
|
||||||
|
@@ -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()
|
||||||
}()
|
}()
|
||||||
|
Reference in New Issue
Block a user