mirror of
https://github.com/distribution/distribution.git
synced 2025-09-19 18:02:52 +00:00
when deploy registry as a pull through cache ,function copeContent() may cause a socket leak when docker user canceled its pull operation.
Signed-off-by: yaoyao.xyy <yaoyao.xyy@alibaba-inc.com>
This commit is contained in:
@@ -55,6 +55,8 @@ func (pbs *proxyBlobStore) copyContent(ctx context.Context, dgst digest.Digest,
|
|||||||
return distribution.Descriptor{}, err
|
return distribution.Descriptor{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer remoteReader.Close()
|
||||||
|
|
||||||
_, err = io.CopyN(writer, remoteReader, desc.Size)
|
_, err = io.CopyN(writer, remoteReader, desc.Size)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return distribution.Descriptor{}, err
|
return distribution.Descriptor{}, err
|
||||||
|
Reference in New Issue
Block a user