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:
yaoyao.xyy 2016-08-02 11:10:10 +08:00
parent 87917f3052
commit 64c8dd3252
1 changed files with 2 additions and 0 deletions

View File

@ -55,6 +55,8 @@ func (pbs *proxyBlobStore) copyContent(ctx context.Context, dgst digest.Digest,
return distribution.Descriptor{}, err
}
defer remoteReader.Close()
_, err = io.CopyN(writer, remoteReader, desc.Size)
if err != nil {
return distribution.Descriptor{}, err