moby--moby/distribution
Aaron Lehmann c5769cf53b Pull: only close temporary file once
Close could be called twice on a temporary download file, which could
have bad side effects.

This fixes the problem by setting to ld.tmpFile to nil when the download
completes sucessfully. Then the call to ld.Close will have no effect,
and only the download manager will close the temporary file when it's
done extracting the layer from it. ld.Close will be responsible for
closing the file if we hit the retry limit and there is still a partial
download present.

Fixes #21675

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 930ae3dbcb)
2016-03-31 18:35:38 -04:00
..
fixtures/validate_manifest
metadata
xfer
errors.go
pull.go
pull_v1.go Pull: only close temporary file once 2016-03-31 18:35:38 -04:00
pull_v2.go Pull: only close temporary file once 2016-03-31 18:35:38 -04:00
pull_v2_test.go
pull_v2_unix.go
pull_v2_windows.go
push.go
push_v1.go
push_v2.go
registry.go
registry_unit_test.go