XL: Fix GetObject erasure decode issues. (#1793)

This commit is contained in:
Harshavardhana
2016-05-29 15:38:14 -07:00
parent 5e8de786b3
commit a4a0ea605b
12 changed files with 154 additions and 146 deletions
+3 -7
View File
@@ -160,8 +160,8 @@ func (fs fsObjects) GetObject(bucket, object string, startOffset int64, length i
for totalLeft > 0 {
// Figure out the right blockSize as it was encoded before.
var curBlockSize int64
if blockSize < totalLeft {
curBlockSize = blockSize
if blockSizeV1 < totalLeft {
curBlockSize = blockSizeV1
} else {
curBlockSize = totalLeft
}
@@ -212,10 +212,6 @@ func (fs fsObjects) GetObjectInfo(bucket, object string) (ObjectInfo, error) {
}, nil
}
const (
blockSize = 4 * 1024 * 1024 // 4MiB.
)
// PutObject - create an object.
func (fs fsObjects) PutObject(bucket string, object string, size int64, data io.Reader, metadata map[string]string) (string, error) {
// Verify if bucket is valid.
@@ -245,7 +241,7 @@ func (fs fsObjects) PutObject(bucket string, object string, size int64, data io.
}
} else {
// Allocate buffer.
buf := make([]byte, blockSize)
buf := make([]byte, blockSizeV1)
for {
n, rErr := data.Read(buf)
if rErr == io.EOF {