Commit f302873
committed
feat(http): segmented parallel download via HTTP Range; bump 0.3.0
aria2-style multi-connection downloads. download_to_file_parallel()
probes with Range: bytes=0-0, then splits the file into segments
fetched concurrently into a pre-allocated file by a worker pool
pulling from a shared segment index:
- maxConnectionsPerFile caps concurrent workers (-x)
- maxSegments sets the split count (-s); 0 ties it to the connection
count, preserving the pre-feature behavior
- minSegmentBytes sets the smallest split worth making (--min-split-size)
- interrupted segments resume mid-range on retry (2 retries each)
- falls back to the sequential path when the server ignores Range,
the resource is empty (416), or the file is too small to split
- 206 responses are validated (Content-Range start/total, no chunked
framing) so a misbehaving server cannot corrupt the output
- progress callbacks stay monotonic across worker threads
All existing API is unchanged; default config (maxConnectionsPerFile=1)
behaves exactly like before.1 parent 82ac733 commit f302873
3 files changed
Lines changed: 576 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
4 | | - | |
5 | | - | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
0 commit comments