Expand description
HTTP transport: control files, byte ranges, and planning range requests.
HttpClient fetches a control file and the byte ranges of a target. The
free functions turn the block ranges a matcher still needs into byte
ranges, and merge ranges separated by small gaps, since one request that
re-downloads a few known bytes is usually cheaper than another round trip.
Structs§
- Http
Client - HTTP transport for fetching control files and byte ranges.
- Http
Range Reader - The body of one range response, capped at the length requested.
Enums§
- Http
Error - Why a fetch failed.
Constants§
- CONNECT_
TIMEOUT - Cap on establishing a connection, covering the TCP handshake and TLS setup but never the transfer that follows.
- DEFAULT_
RANGE_ GAP_ THRESHOLD - Default gap threshold for range merging (256 KiB, same as zsync2).
- RESOLVE_
TIMEOUT - Cap on the DNS lookup, for the same reason as
CONNECT_TIMEOUT.
Functions§
- byte_
ranges_ from_ block_ ranges - Converts block ranges into the byte ranges that hold them.
- merge_
byte_ ranges - Merge byte ranges to minimize HTTP requests.