mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Fix resumable downloads so that the curl engine offset point is reset post successful download (#3406)
* Ensure that post successful download, the resumable offset point is reset to avoid `HTTP request returned status code 416 (Requested Range Not Satisfiable)` if the offset point is not reset and curl engine reused for another download
This commit is contained in:
parent
b6fa6f8fe4
commit
5f14530745
2 changed files with 8 additions and 0 deletions
|
|
@ -598,6 +598,11 @@ class CurlEngine {
|
|||
void setDownloadResumeOffset(long offset) {
|
||||
resumeFromOffset = offset;
|
||||
}
|
||||
|
||||
// reset resumable offset point to negative value
|
||||
void resetDownloadResumeOffset() {
|
||||
resumeFromOffset = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Methods to control obtaining and releasing a CurlEngine instance from the curlEnginePool
|
||||
|
|
|
|||
|
|
@ -1559,6 +1559,9 @@ class OneDriveApi {
|
|||
|
||||
// Safe remove 'threadResumeDownloadFilePath' as if we get to this point, the file has been download successfully
|
||||
safeRemove(threadResumeDownloadFilePath);
|
||||
|
||||
// Reset this curlEngine offset value now that the file has been downloaded successfully
|
||||
curlEngine.resetDownloadResumeOffset();
|
||||
|
||||
// Return the applicable result
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue