Skip to content

Commit

Permalink
ensure stream is closed in localhost provider (moby#36)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
  • Loading branch information
alexcb authored Apr 1, 2021
1 parent 5b54467 commit d20d543
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions session/localhost/localhost.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func LocalhostExec(ctx context.Context, c session.Caller, args []string, dir str
if err != nil {
return errors.WithStack(err)
}
defer stream.CloseSend()

req := InputMessage{
Command: args,
Expand Down Expand Up @@ -91,6 +92,7 @@ func LocalhostGet(ctx context.Context, c session.Caller, src, dest string, mount
if err != nil {
return errors.WithStack(err)
}
defer stream.CloseSend()

req := BytesMessage{
Data: []byte(src),
Expand Down Expand Up @@ -213,6 +215,7 @@ func LocalhostPut(ctx context.Context, c session.Caller, src, dst string) error
if err != nil {
return errors.WithStack(err)
}
defer stream.CloseSend()

fi, err := os.Stat(src)
if err != nil {
Expand Down

0 comments on commit d20d543

Please sign in to comment.