Skip to content

Commit 8fc6101

Browse files
committed
[ssh-gateway] fix missing output when running simple command
1 parent c141f7c commit 8fc6101

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

components/ws-proxy/pkg/sshproxy/forward.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,12 @@ func (s *Server) ChannelForward(ctx context.Context, session *Session, targetCon
5555

5656
go func() {
5757
io.Copy(targetChan, originChan)
58-
targetChan.CloseWrite()
59-
log.Info("originChan channel closed")
58+
targetChan.Close()
6059
}()
6160

6261
go func() {
6362
io.Copy(originChan, targetChan)
64-
originChan.CloseWrite()
65-
log.Info("targetChan channel closed")
63+
originChan.Close()
6664
}()
6765

6866
go func() {
@@ -80,7 +78,6 @@ func (s *Server) ChannelForward(ctx context.Context, session *Session, targetCon
8078
select {
8179
case req, ok := <-sourceReqs:
8280
if !ok {
83-
targetChan.Close()
8481
return
8582
}
8683
b, err := targetChan.SendRequest(req.Type, req.WantReply, req.Payload)

0 commit comments

Comments
 (0)