File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -719,12 +719,16 @@ func (c *Common) commonTCPLoop() {
719719 // 注册取消函数
720720 c .cancelMap .Store (id , func () {
721721 if targetConn != nil {
722- targetConn .Close ()
722+ targetConn .SetReadDeadline (time .Now ())
723+ }
724+ if remoteConn != nil {
725+ remoteConn .SetReadDeadline (time .Now ())
723726 }
724727 })
725728 defer c .cancelMap .Delete (id )
726729
727730 defer func () {
731+ remoteConn .SetReadDeadline (time.Time {})
728732 c .tunnelPool .Put (id , remoteConn )
729733 c .logger .Debug ("Tunnel connection: put %v -> pool active %v" , id , c .tunnelPool .Active ())
730734
@@ -1039,6 +1043,7 @@ func (c *Common) commonTCPOnce(signalURL *url.URL) {
10391043 c .logger .Debug ("Tunnel connection: get %v <- pool active %v" , id , c .tunnelPool .Active ())
10401044
10411045 defer func () {
1046+ remoteConn .SetReadDeadline (time.Time {})
10421047 c .tunnelPool .Put (id , remoteConn )
10431048 c .logger .Debug ("Tunnel connection: put %v -> pool active %v" , id , c .tunnelPool .Active ())
10441049
@@ -1079,7 +1084,10 @@ func (c *Common) commonTCPOnce(signalURL *url.URL) {
10791084 // 注册取消函数
10801085 c .cancelMap .Store (id , func () {
10811086 if targetConn != nil {
1082- targetConn .Close ()
1087+ targetConn .SetReadDeadline (time .Now ())
1088+ }
1089+ if remoteConn != nil {
1090+ remoteConn .SetReadDeadline (time .Now ())
10831091 }
10841092 })
10851093 defer c .cancelMap .Delete (id )
You can’t perform that action at this time.
0 commit comments