Skip to content

[Backport release-0-28.1] Fix download resume corruption when server returns HTTP 200#13024

Merged
TobiGr merged 1 commit intorelease-0-28.1from
backport-13014-to-release-0-28.1
Jan 9, 2026
Merged

[Backport release-0-28.1] Fix download resume corruption when server returns HTTP 200#13024
TobiGr merged 1 commit intorelease-0-28.1from
backport-13014-to-release-0-28.1

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented Jan 9, 2026

Description

Backport of #13014 to release-0-28.1.

When resuming a download after interruption, if the server returns
HTTP 200 (full resource) instead of HTTP 206 (partial content), the
code correctly resets mMission.done but fails to reset the 'start'
variable. This causes the subsequent file seek to use a stale offset,
writing new data at incorrect positions.

This bug causes file corruption for large downloads (>5GB) that are
interrupted and resumed, particularly when:
- Switching between WiFi networks
- Server CDN returning different responses
- Connection drops during long downloads

The corruption manifests as duplicate data regions in the file,
which for MP4 downloads results in multiple MOOV atoms and
broken seek functionality.

Fix: Reset start=0 when HTTP 200 is received, ensuring the file
write position correctly restarts from the beginning of the current
resource.

(cherry picked from commit 08008ca)
@github-actions github-actions bot added bug Issue is related to a bug downloader Issue is related to the downloader size/small PRs with less than 50 changed lines template ignored The user didn't follow the template/instructions (or removed them) backport labels Jan 9, 2026
@TobiGr TobiGr merged commit dc5c5b6 into release-0-28.1 Jan 9, 2026
@TobiGr TobiGr deleted the backport-13014-to-release-0-28.1 branch January 9, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Issue is related to a bug downloader Issue is related to the downloader size/small PRs with less than 50 changed lines template ignored The user didn't follow the template/instructions (or removed them)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants