Skip to content

Commit bdd05d2

Browse files
committed
Revert additional stream closed polling on proxy command
1 parent eeec10e commit bdd05d2

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

pkg/granted/proxy/listenandproxy.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ package proxy
22

33
import (
44
"context"
5-
"errors"
65
"fmt"
76
"io"
87
"net"
9-
"time"
108

119
"github.com/common-fate/clio"
1210
"github.com/common-fate/clio/clierr"
@@ -95,26 +93,6 @@ func ListenAndProxy(ctx context.Context, yamuxStreamConnection *yamux.Session, c
9593
}
9694

9795
}()
98-
99-
// This function polls the stream connection to see if it has been closed remotely
100-
// https://github.com/hashicorp/yamux/pull/115
101-
// when the proxy server has errors which are fatal to this session, it will close the stream
102-
go func() {
103-
defer clientConn.Close()
104-
defer sessionConn.Close()
105-
for {
106-
b := make([]byte, 0)
107-
_, err := sessionConn.Read(b)
108-
if err != nil {
109-
if errors.Is(err, io.EOF) {
110-
clio.Infof("The proxy server ended the connection for the session unexpectedly [%v]", sessionConn.StreamID())
111-
return
112-
}
113-
}
114-
time.Sleep(time.Second)
115-
}
116-
117-
}()
11896
}(result.conn)
11997
}
12098
}

0 commit comments

Comments
 (0)