Skip to content

Commit f302873

Browse files
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

File tree

mcpp.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ version = 2
55
namespace = "compat"
66
version = "3.6.1"
77
source = "index+compat@3.6.1"
8-
hash = "fnv1a:83dea67ac1379be3"
8+
hash = "fnv1a:bb700e69e973ccd0"
99

mcpp.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
# Local fork of mcpplibs/tinyhttps 0.2.9 with segmented parallel downloads
2+
# (HTTP Range multi-connection, aria2-style). All existing API is unchanged;
3+
# the new surface is HttpClientConfig.maxConnectionsPerFile and
4+
# HttpClient::download_to_file_parallel().
15
[package]
26
namespace = "mcpplibs"
37
name = "tinyhttps"
4-
version = "0.2.9"
5-
description = "Minimal C++23 HTTP/HTTPS client with SSE streaming support"
8+
version = "0.3.0"
9+
description = "Minimal C++23 HTTP/HTTPS client (fork: + Range segmented parallel download)"
610
license = "Apache-2.0"
711
repo = "https://github.com/mcpplibs/tinyhttps"
812

0 commit comments

Comments
 (0)