mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 21:20:23 +03:00
ObjectLayer/GetObject: Should return the right error value. Fix done in FS and XL. (#2133)
fixes #2117
This commit is contained in:
committed by
Harshavardhana
parent
5102a5877e
commit
ae80f8ca35
@@ -248,7 +248,7 @@ func (fs fsObjects) GetObject(bucket, object string, offset int64, length int64,
|
||||
}
|
||||
// Allocate a staging buffer.
|
||||
buf := make([]byte, int(bufSize))
|
||||
for totalLeft > 0 {
|
||||
for {
|
||||
// Figure out the right size for the buffer.
|
||||
curLeft := bufSize
|
||||
if totalLeft < bufSize {
|
||||
@@ -282,6 +282,9 @@ func (fs fsObjects) GetObject(bucket, object string, offset int64, length int64,
|
||||
err = er
|
||||
break
|
||||
}
|
||||
if totalLeft == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
// Returns any error.
|
||||
return toObjectErr(err, bucket, object)
|
||||
|
||||
Reference in New Issue
Block a user