1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #22356 from allencloud/close-http-response-body-when-attaching

close http response body when attaching
This commit is contained in:
Arnaud Porterie 2016-05-11 12:44:35 -10:00
commit 28452ca783

View file

@ -212,6 +212,8 @@ func (cli *DockerCli) CmdRun(args ...string) error {
// keep the error and read detailed error message from hijacked connection later // keep the error and read detailed error message from hijacked connection later
return errAttach return errAttach
} }
defer resp.Close()
ctx, cancelFun = context.WithCancel(context.Background()) ctx, cancelFun = context.WithCancel(context.Background())
errCh = promise.Go(func() error { errCh = promise.Go(func() error {
errHijack := cli.holdHijackedConnection(ctx, config.Tty, in, out, stderr, resp) errHijack := cli.holdHijackedConnection(ctx, config.Tty, in, out, stderr, resp)