close http response body when attaching

Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
allencloud 2016-04-27 16:48:21 +08:00
parent 9a9ebc7f85
commit 54d09c6c2d
1 changed files with 2 additions and 0 deletions

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
return errAttach
}
defer resp.Close()
ctx, cancelFun = context.WithCancel(context.Background())
errCh = promise.Go(func() error {
errHijack := cli.holdHijackedConnection(ctx, config.Tty, in, out, stderr, resp)