Explorar o código

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

close http response body when attaching
Arnaud Porterie %!s(int64=9) %!d(string=hai) anos
pai
achega
28452ca783
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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)