diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2020-09-19 19:53:03 +0100 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2020-09-19 19:53:03 +0100 |
| commit | f7849d259668b408829f2b2e8d29b9753eff390a (patch) | |
| tree | 2e1dcee66abeef22a12c27e7a633baa27f2773fe /internal/clients/remote/connection.go | |
| parent | cdbcef72a1b9f93d08455b5a77f7f7afa2b9f53d (diff) | |
| parent | 3c889d2eed4e12af505ea84d46d8e52d21057a1f (diff) | |
Merge branch 'develop' of https://github.com/mimecast/dtail into develop
Diffstat (limited to 'internal/clients/remote/connection.go')
| -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 } |
