Skip to main content

Module http

Module http 

Source
Expand description

The installer’s only HTTP client: WinHTTP, whose TLS is the OS’s own Schannel. Blocking, so it runs on the worker thread, never the UI thread.

Re-exports§

pub use http_error::HttpError;

Modules§

http_error 🔒
request_handle 🔒
url_target 🔒

Constants§

CHUNK_SIZE 🔒
Small enough that Cancel is noticed promptly.
MAX_BUFFERED_BYTES 🔒
What get holds in memory: far beyond any real manifest, which runs to kilobytes, and small enough that a server sending without end cannot exhaust the machine; that the documents are small is the server’s promise, not ours.
MAX_REDIRECTS 🔒
Enough for a host move followed by a path rewrite, and a loop ends in milliseconds rather than on the timeout.
TIMEOUT_CONNECT_MS 🔒
TIMEOUT_RECEIVE_MS 🔒
TIMEOUT_RESOLVE_MS 🔒
Without timeouts a dead server parks the worker forever, since Cancel is only noticed between chunks.
TIMEOUT_SEND_MS 🔒
USER_AGENT 🔒
The server’s access log records it, so a report can be traced to the build that sent it.

Functions§

get
The whole body in memory, up to MAX_BUFFERED_BYTES: right for a manifest, wrong for a package zip.
get_streaming
Hands each chunk to sink as it arrives; sink returns false to abort. The bearer token is a credential and is never logged.
post_json
Posts JSON without a token, since what the installer sends carries no identity, and discards the response body.
read_body 🔒
read_response 🔒
redirect_location 🔒
The Location of a 3xx, whose body is never read: it belongs to a response the caller is not getting, and would otherwise land in a package file.
send 🔒
Follows redirects itself, since WinHTTP left to itself re-sends the bearer token to whatever origin a 3xx names (measured 2026-10-30).

Type Aliases§

ProgressFn
(bytes_so_far, content_length); the length is None for a chunked response.