|
@ -84,7 +84,6 @@ type duplexConn interface { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (h *tcpHandler) relay(lhs, rhs net.Conn, sess *stats.Session) { |
|
|
func (h *tcpHandler) relay(lhs, rhs net.Conn, sess *stats.Session) { |
|
|
var err error |
|
|
|
|
|
upCh := make(chan struct{}) |
|
|
upCh := make(chan struct{}) |
|
|
|
|
|
|
|
|
cls := func(dir direction, interrupt bool) { |
|
|
cls := func(dir direction, interrupt bool) { |
|
@ -109,6 +108,7 @@ func (h *tcpHandler) relay(lhs, rhs net.Conn, sess *stats.Session) { |
|
|
|
|
|
|
|
|
// Uplink
|
|
|
// Uplink
|
|
|
go func() { |
|
|
go func() { |
|
|
|
|
|
var err error |
|
|
if h.sessionStater != nil && sess != nil { |
|
|
if h.sessionStater != nil && sess != nil { |
|
|
_, err = statsCopy(rhs, lhs, sess, dirUplink) |
|
|
_, err = statsCopy(rhs, lhs, sess, dirUplink) |
|
|
} else { |
|
|
} else { |
|
@ -123,6 +123,7 @@ func (h *tcpHandler) relay(lhs, rhs net.Conn, sess *stats.Session) { |
|
|
}() |
|
|
}() |
|
|
|
|
|
|
|
|
// Downlink
|
|
|
// Downlink
|
|
|
|
|
|
var err error |
|
|
if h.sessionStater != nil && sess != nil { |
|
|
if h.sessionStater != nil && sess != nil { |
|
|
_, err = statsCopy(lhs, rhs, sess, dirDownlink) |
|
|
_, err = statsCopy(lhs, rhs, sess, dirDownlink) |
|
|
} else { |
|
|
} else { |
|
|