mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
UploadPartCopy read the copied range into a byte array and stored it through the byte-array UploadPart path, so one copied part was capped near 2 GiB with EntityTooLarge, while S3 allows a part of up to 5 GiB. The range is now read from the source stream as it is needed, by a new CopyRangeInputStream that skips to the range on its first read and ends after its last byte, and written straight into the part through the streaming UploadPart path, so neither the source nor the part has to fit in memory in the disk-backed modes. A range over S3's 5 GiB part limit is rejected with EntityTooLarge, as the S3 API Reference error table words it, before anything is copied. Memory mode keeps its limit of about 2 GiB.