Skip to content

Commit f30e4a0

Browse files
committed
rebase & feedback
1 parent e57afc4 commit f30e4a0

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

internal/communicator/ssh/communicator.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -996,13 +996,6 @@ func (c *proxyCommandConn) Read(b []byte) (int, error) {
996996

997997
// Write writes data to the connection (the command's stdin)
998998
func (c *proxyCommandConn) Write(b []byte) (int, error) {
999-
c.mutex.Lock()
1000-
if c.closed {
1001-
c.mutex.Unlock()
1002-
return 0, io.ErrClosedPipe
1003-
}
1004-
c.mutex.Unlock()
1005-
1006999
return c.stdinPipe.Write(b)
10071000
}
10081001

@@ -1022,6 +1015,7 @@ func (c *proxyCommandConn) Close() error {
10221015

10231016
// Cancel the context to signal the command to terminate
10241017
c.cancel()
1018+
c.cmd.Wait()
10251019

10261020
// If the command failed, log the stderr output
10271021
if c.stderr.Len() > 0 {

0 commit comments

Comments
 (0)