mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Layer LimitReader responsibly allowing sign verification to work (#2821)
This commit is contained in:
parent
ddeb8242d8
commit
83e6e1060e
@ -387,15 +387,16 @@ func (xl xlObjects) PutObjectPart(bucket, object, uploadID string, partID int, s
|
|||||||
// Initialize md5 writer.
|
// Initialize md5 writer.
|
||||||
md5Writer := md5.New()
|
md5Writer := md5.New()
|
||||||
|
|
||||||
|
lreader := data
|
||||||
// Limit the reader to its provided size > 0.
|
// Limit the reader to its provided size > 0.
|
||||||
if size > 0 {
|
if size > 0 {
|
||||||
// This is done so that we can avoid erroneous clients sending
|
// This is done so that we can avoid erroneous clients sending
|
||||||
// more data than the set content size.
|
// more data than the set content size.
|
||||||
data = io.LimitReader(data, size)
|
lreader = io.LimitReader(data, size)
|
||||||
} // else we read till EOF.
|
} // else we read till EOF.
|
||||||
|
|
||||||
// Construct a tee reader for md5sum.
|
// Construct a tee reader for md5sum.
|
||||||
teeReader := io.TeeReader(data, md5Writer)
|
teeReader := io.TeeReader(lreader, md5Writer)
|
||||||
|
|
||||||
// Erasure code data and write across all disks.
|
// Erasure code data and write across all disks.
|
||||||
sizeWritten, checkSums, err := erasureCreateFile(onlineDisks, minioMetaBucket, tmpPartPath, teeReader, xlMeta.Erasure.BlockSize, xl.dataBlocks, xl.parityBlocks, bitRotAlgo, xl.writeQuorum)
|
sizeWritten, checkSums, err := erasureCreateFile(onlineDisks, minioMetaBucket, tmpPartPath, teeReader, xlMeta.Erasure.BlockSize, xl.dataBlocks, xl.parityBlocks, bitRotAlgo, xl.writeQuorum)
|
||||||
|
Loading…
Reference in New Issue
Block a user