mirror of
https://github.com/lubosz/overte.git
synced 2025-04-15 19:47:38 +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();
|
||||
|
||||
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
|
||||
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
|
||||
// (3) the fromExclusive of the range is negative, and the toExclusive isn't zero
|
||||
bool isValid() {
|
||||
return toExclusive < 0
|
||||
|| (toExclusive < fromInclusive && toExclusive != 0)
|
||||
|| (fromInclusive < 0 && toExclusive != 0);
|
||||
return toExclusive >= 0
|
||||
&& (toExclusive >= fromInclusive || toExclusive == 0)
|
||||
&& (fromInclusive >= 0 || toExclusive == 0);
|
||||
}
|
||||
|
||||
void fixupRange(int64_t fileSize) {
|
||||
|
|
Loading…
Reference in a new issue