@@ -20,7 +20,7 @@ func (s *Server) ChannelForward(ctx context.Context, session *Session, targetCon
20
20
targetChan , targetReqs , err := targetConn .OpenChannel (originChannel .ChannelType (), originChannel .ExtraData ())
21
21
if err != nil {
22
22
log .WithFields (log .OWI ("" , session .WorkspaceID , session .InstanceID )).Error ("open target channel error" )
23
- originChannel .Reject (ssh .ConnectionFailed , "open target channel error" )
23
+ _ = originChannel .Reject (ssh .ConnectionFailed , "open target channel error" )
24
24
return
25
25
}
26
26
defer targetChan .Close ()
@@ -54,21 +54,21 @@ func (s *Server) ChannelForward(ctx context.Context, session *Session, targetCon
54
54
}()
55
55
56
56
go func () {
57
- io .Copy (targetChan , originChan )
58
- targetChan .CloseWrite ()
57
+ _ , _ = io .Copy (targetChan , originChan )
58
+ _ = targetChan .Close ()
59
59
}()
60
60
61
61
go func () {
62
- io .Copy (originChan , targetChan )
63
- originChan .CloseWrite ()
62
+ _ , _ = io .Copy (originChan , targetChan )
63
+ _ = originChan .Close ()
64
64
}()
65
65
66
66
go func () {
67
- io .Copy (targetChan .Stderr (), originChan .Stderr ())
67
+ _ , _ = io .Copy (targetChan .Stderr (), originChan .Stderr ())
68
68
}()
69
69
70
70
go func () {
71
- io .Copy (originChan .Stderr (), targetChan .Stderr ())
71
+ _ , _ = io .Copy (originChan .Stderr (), targetChan .Stderr ())
72
72
}()
73
73
74
74
wg := sync.WaitGroup {}
@@ -78,7 +78,6 @@ func (s *Server) ChannelForward(ctx context.Context, session *Session, targetCon
78
78
select {
79
79
case req , ok := <- sourceReqs :
80
80
if ! ok {
81
- targetChan .Close ()
82
81
return
83
82
}
84
83
b , err := targetChan .SendRequest (req .Type , req .WantReply , req .Payload )
0 commit comments