diff options
| author | chrislu <chris.lu@gmail.com> | 2022-02-26 03:23:06 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-02-26 03:23:06 -0800 |
| commit | 3a58b7bac63349b938c76a6c07ca5275d92bb0bd (patch) | |
| tree | 6f67ed98eae87855c230b33c4e6f792f26690f0c | |
| parent | 708e14fcfa7182a08a8ed02c250d49de8eb3b5a6 (diff) | |
| download | seaweedfs-3a58b7bac63349b938c76a6c07ca5275d92bb0bd.tar.xz seaweedfs-3a58b7bac63349b938c76a6c07ca5275d92bb0bd.zip | |
a little safer
| -rw-r--r-- | weed/filer/filechunk_manifest.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/filer/filechunk_manifest.go b/weed/filer/filechunk_manifest.go index 2c9dc5e74..372901b7d 100644 --- a/weed/filer/filechunk_manifest.go +++ b/weed/filer/filechunk_manifest.go @@ -124,8 +124,10 @@ func retriedFetchChunkData(buffer []byte, urlStrings []string, cipherKey []byte, urlString = url.PathEscape(urlString) } shouldRetry, err = util.ReadUrlAsStream(urlString+"?readDeleted=true", cipherKey, isGzipped, isFullChunk, offset, len(buffer), func(data []byte) { - x := copy(buffer[n:], data) - n += x + if n < len(buffer) { + x := copy(buffer[n:], data) + n += x + } }) if !shouldRetry { break |
