We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
closeLocally
1 parent d7adb5c commit 3668ad5Copy full SHA for 3668ad5
proxy/session/stream.go
@@ -64,12 +64,20 @@ func (s *Stream) Close() error {
64
return s.closeWithError(io.ErrClosedPipe)
65
}
66
67
-// closeLocally only closes Stream and don't call Session or dieHook
+// closeLocally only closes Stream and don't notify remote peer
68
func (s *Stream) closeLocally() {
69
+ var once bool
70
s.dieOnce.Do(func() {
71
s.dieErr = net.ErrClosed
72
s.pipeR.Close()
73
+ once = true
74
})
75
+ if once {
76
+ if s.dieHook != nil {
77
+ s.dieHook()
78
+ s.dieHook = nil
79
+ }
80
81
82
83
func (s *Stream) closeWithError(err error) error {
0 commit comments