Skip to content

Commit 0d4aa06

Browse files
committed
fix(139): include part 101 when fetching remaining upload URLs
The create request only carries the first 100 part infos (index 0..99, i.e. partNumber 1..100), but the loop that fetches the remaining upload URLs started at index 101, which is partNumber 102. Index 100 (partNumber 101) was therefore never requested. Because every part is read sequentially from one shared reader and the part size is looked up by PartNumber, skipping a part does not just drop its data: after part 100 the loop jumps to part 102 while the reader still yields part 101's bytes, so every subsequent part is written to the wrong part number and the upload ends one part short. The final /file/complete then fails its contentHash check. This affects personal_new uploads whose part count exceeds 100 - files larger than 10 GB with the default 100 MB part size, and larger than 51.2 GB once the 512 MB part size kicks in above 30 GB.
1 parent 8d77000 commit 0d4aa06

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/139/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ func (d *Yun139) Put(ctx context.Context, dstDir model.Obj, stream model.FileStr
591591
uploadPartInfos := resp.Data.PartInfos
592592

593593
// 获取后续分片的上传地址
594-
for i := 101; i < len(partInfos); i += 100 {
594+
for i := 100; i < len(partInfos); i += 100 {
595595
end := i + 100
596596
if end > len(partInfos) {
597597
end = len(partInfos)

0 commit comments

Comments
 (0)