mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 07:19:21 +02:00
fix valid byte range check and send asset from 0
This commit is contained in:
parent
d9c5997b63
commit
3928e11611
2 changed files with 4 additions and 4 deletions
|
@ -88,7 +88,7 @@ void SendAssetTask::run() {
|
||||||
|
|
||||||
auto size = byteRange.size();
|
auto size = byteRange.size();
|
||||||
|
|
||||||
if (byteRange.fromInclusive > 0) {
|
if (byteRange.fromInclusive >= 0) {
|
||||||
|
|
||||||
// this range is positive, meaning we just need to seek into the file and then read from there
|
// this range is positive, meaning we just need to seek into the file and then read from there
|
||||||
file.seek(byteRange.fromInclusive);
|
file.seek(byteRange.fromInclusive);
|
||||||
|
|
|
@ -24,9 +24,9 @@ struct ByteRange {
|
||||||
// (2) the toExclusive of the range is less than the fromInclusive, and isn't zero
|
// (2) the toExclusive of the range is less than the fromInclusive, and isn't zero
|
||||||
// (3) the fromExclusive of the range is negative, and the toExclusive isn't zero
|
// (3) the fromExclusive of the range is negative, and the toExclusive isn't zero
|
||||||
bool isValid() {
|
bool isValid() {
|
||||||
return toExclusive < 0
|
return toExclusive >= 0
|
||||||
|| (toExclusive < fromInclusive && toExclusive != 0)
|
&& (toExclusive >= fromInclusive || toExclusive == 0)
|
||||||
|| (fromInclusive < 0 && toExclusive != 0);
|
&& (fromInclusive >= 0 || toExclusive == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fixupRange(int64_t fileSize) {
|
void fixupRange(int64_t fileSize) {
|
||||||
|
|
Loading…
Reference in a new issue