Fixes to downloader range requests, improvements to input bufferFrame code

This commit is contained in:
Thulinma 2023-03-30 02:20:23 +02:00
parent 393fa9e403
commit d097273859
2 changed files with 25 additions and 7 deletions

View file

@ -270,8 +270,17 @@ namespace HTTP{
}else{
sprintf(tmp, "bytes=%zu-%zu", byteStart, byteEnd - 1);
}
extraHeaders.erase("Range");
setHeader("Range", tmp);
return getNonBlocking(link, 6);
if (!canRequest(link)){return false;}
nbLink = link;
nbMaxRecursiveDepth = 6;
nbLoop = retryCount + 1; // max 5 attempts
isComplete = false;
doRequest(nbLink);
nbReqTime = Util::bootSecs();
nbLastOff = getSocket().dataDown();
return true;
}
bool Downloader::getRange(const HTTP::URL &link, size_t byteStart, size_t byteEnd, Util::DataCallback &cb){