mirror of
https://github.com/minio/minio.git
synced 2025-11-12 14:51:36 -05:00
Handled possible short writes to httpResponseWriter (#1804)
* XL: Handled possible short writes to httpResponseWriter * Added tests for Range Header combinations
This commit is contained in:
committed by
Harshavardhana
parent
b466f27705
commit
967c2b2940
@@ -19,7 +19,7 @@ package main
|
||||
import "errors"
|
||||
|
||||
// ReadFile - decoded erasure coded file.
|
||||
func (e erasure) ReadFile(volume, path string, bufferOffset int64, startOffset int64, buffer []byte) (int64, error) {
|
||||
func (e erasure) ReadFile(volume, path string, startOffset int64, buffer []byte) (int64, error) {
|
||||
// Calculate the current encoded block size.
|
||||
curEncBlockSize := getEncodedBlockLen(int64(len(buffer)), e.DataBlocks)
|
||||
offsetEncOffset := getEncodedBlockLen(startOffset, e.DataBlocks)
|
||||
@@ -89,7 +89,7 @@ func (e erasure) ReadFile(volume, path string, bufferOffset int64, startOffset i
|
||||
}
|
||||
|
||||
// Copy data blocks.
|
||||
copy(buffer, dataBlocks[bufferOffset:])
|
||||
copy(buffer, dataBlocks)
|
||||
|
||||
// Relenquish memory.
|
||||
dataBlocks = nil
|
||||
|
||||
Reference in New Issue
Block a user