cache - fix corruption when client prematurely terminates request (#8155)

This commit is contained in:
poornas
2019-09-05 11:03:32 -07:00
committed by kannappanr
parent 29f64355ce
commit 259a5d825b
2 changed files with 9 additions and 6 deletions

View File

@@ -240,7 +240,7 @@ func (c *cacheObjects) GetObjectNInfo(ctx context.Context, bucket, object string
pipeWriter.CloseWithError(putErr)
}()
cleanupBackend := func() { bkReader.Close() }
cleanupPipe := func() { pipeReader.Close() }
cleanupPipe := func() { pipeWriter.Close() }
return NewGetObjectReaderFromReader(teeReader, bkReader.ObjInfo, opts.CheckCopyPrecondFn, cleanupBackend, cleanupPipe)
}