Skip to main content

Module constants

Module constants 

Source
Expand description

Protocol constants shared between server and client.

Constants§

CHUNK_SIZE
Fixed chunk size for fragmented transfers (2 MiB).
DEFAULT_CONCURRENCY
Maximum default concurrent connections in the WASM engine.
DEFAULT_DOWNLOAD_CHUNK_SIZE
Default chunk size for parallel (byte-range) downloads — 256 KiB.
DEFAULT_DOWNLOAD_WINDOW
Default in-flight chunk window for a single file’s download.
DEFAULT_MAX_UPLOAD_SIZE
Default cap for a single upload (100 GiB, configurable by the server).
DEFAULT_SESSION_TTL
Server-side TTL after which an unfinished “session” upload temp (and its .blocks range sidecar) is considered stale and garbage-collected.
DEFAULT_UPLOAD_WINDOW
Default in-flight chunk window for a single file’s upload.
HEADER_COMPRESS
HTTP header advertising the compression algorithm on a body stream.
HEADER_FILE_META
HTTP header carrying JSON-encoded FileMeta for an upload or download.
HEADER_FINAL
HTTP header marking an upload request as the FINAL chunk of a file.
HEADER_OFFSET
HTTP header carrying the byte offset to resume an interrupted upload.
HEADER_PROTOCOL
HTTP header carrying the (optional) transfer version handshake.
HEADER_SESSION
HTTP header carrying a per-upload session id.
HEADER_SESSION_STATUS
HTTP header turning a session POST into a status probe.
MAX_RETRIES
Default maximum retry count for a failed chunk before failing the task.
MIN_PARALLEL_DOWNLOAD_BYTES
A file with fewer remaining bytes than this stays on the sequential single-connection download path; larger files use the parallel range-GET path (which has per-request overhead that only pays off at size).
PROTOCOL_NAME
Protocol name used in the handshake header.
PROTOCOL_VERSION
Protocol version used in the handshake header.
STREAM_BUF_SIZE
Constant sliding-window size for streaming (64 KiB).

Functions§

protocol_compatible
Whether a received x-libfw-protocol handshake value is compatible with this build of the library.
protocol_header_value
The canonical x-libfw-protocol header value (e.g. libfw/1).