Skip to content

Fix CanWrite condition - #222

Merged
bezzad merged 1 commit into
bezzad:masterfrom
YerongAI:patch-1
Apr 20, 2026
Merged

Fix CanWrite condition#222
bezzad merged 1 commit into
bezzad:masterfrom
YerongAI:patch-1

Conversation

@YerongAI

Copy link
Copy Markdown
Contributor

The BlockSize is 1024 by default. When a file is divided into exactly 1025 bytes each chunk. The ChunkDownloader will download 1024 bytes first, and write to the chunk Stream.

After that, the Chunk Position will be changed to 1024, however, there is still 1 byte of stream to be downloaded.

The Start + Position < End will be false. Because 0+1024<1024. Change it to Start + Position <= End can fix the problem.

@bezzad bezzad self-assigned this Apr 20, 2026
@bezzad bezzad added the bug Something isn't working label Apr 20, 2026
@bezzad
bezzad merged commit 18042a1 into bezzad:master Apr 20, 2026
3 of 4 checks passed
@bezzad bezzad linked an issue Apr 20, 2026 that may be closed by this pull request
@YerongAI
YerongAI deleted the patch-1 branch April 20, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Bug] Setting a specific chunk size results in file corruption

2 participants