diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2020-12-08 14:49:41 +0000 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2020-12-08 14:49:41 +0000 |
| commit | 799b9b69ba08b898e13026b7ecab9f9f58580a82 (patch) | |
| tree | 34bc0e5e539aed99dd1f13e7489e9d3111ba050f /internal/clients/remote | |
| parent | 6b2d8539a66f1b36ffd55c56723376b9b068a5dc (diff) | |
merge develop
Diffstat (limited to 'internal/clients/remote')
| -rw-r--r-- | internal/clients/remote/connection.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/clients/remote/connection.go b/internal/clients/remote/connection.go index 2d97d14..b29ffed 100644 --- a/internal/clients/remote/connection.go +++ b/internal/clients/remote/connection.go @@ -177,21 +177,21 @@ func (c *Connection) handle(ctx context.Context, cancel context.CancelFunc, sess } go func() { - defer cancel() io.Copy(stdinPipe, c.Handler) + cancel() }() go func() { - defer cancel() io.Copy(c.Handler, stdoutPipe) + cancel() }() go func() { - defer cancel() select { case <-c.Handler.Done(): case <-ctx.Done(): } + cancel() }() // Send all commands to client. @@ -207,5 +207,6 @@ func (c *Connection) handle(ctx context.Context, cancel context.CancelFunc, sess } <-ctx.Done() + c.Handler.Shutdown() return nil } |
