summaryrefslogtreecommitdiff
path: root/internal/clients/remote
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2020-09-19 19:53:03 +0100
committerPaul Buetow <pbuetow@mimecast.com>2020-09-19 19:53:03 +0100
commitf7849d259668b408829f2b2e8d29b9753eff390a (patch)
tree2e1dcee66abeef22a12c27e7a633baa27f2773fe /internal/clients/remote
parentcdbcef72a1b9f93d08455b5a77f7f7afa2b9f53d (diff)
parent3c889d2eed4e12af505ea84d46d8e52d21057a1f (diff)
Merge branch 'develop' of https://github.com/mimecast/dtail into develop
Diffstat (limited to 'internal/clients/remote')
-rw-r--r--internal/clients/remote/connection.go7
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
}