瀏覽代碼

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

close http response body when attaching
Arnaud Porterie 9 年之前
父節點
當前提交
28452ca783
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      api/client/run.go

+ 2 - 0
api/client/run.go

@@ -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)