As http range header is inclusive of start and end ranges, this otherwise breaks
at ranges close to multipart boundaries
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit
9c92b56d77932283ccc0336645dc3b76bd0fffa2)
off_t in_end = bl_end;
size_t i = 0;
- while (i<parts_len.size() && (in_ofs > (off_t)parts_len[i])) {
+ while (i<parts_len.size() && (in_ofs >= (off_t)parts_len[i])) {
in_ofs -= parts_len[i];
i++;
}
//in_ofs is inside block i
size_t j = 0;
- while (j<parts_len.size() && (in_end > (off_t)parts_len[j])) {
+ while (j<parts_len.size() && (in_end >= (off_t)parts_len[j])) {
in_end -= parts_len[j];
j++;
}