|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
SSH server-to-client compression: a context-takeover DEFLATE stream (no heap). More...
Go to the source code of this file.
SSH server-to-client compression: a context-takeover DEFLATE stream (no heap).
SSH zlib / zlib@openssh.com (RFC 4253 sec 6.2) compress the packet payload with a single zlib stream per direction that is kept alive for the whole session - a persistent sliding window carried across packets ("context takeover"), sync-flushed at each packet boundary. This is the OPPOSITE of the WebSocket permessage-deflate codec (presentation/deflate), which is stateless per message (no_context_takeover); the two cannot share an instance.
Only the SERVER->CLIENT direction is implemented here. It emits a zlib stream (RFC 1950 2-byte header once, then RFC 1951 fixed-Huffman blocks) with a Z_SYNC_FLUSH boundary after every packet: the block is byte-aligned and the empty stored block 00 00 ff ff is KEPT on the wire (unlike permessage-deflate, which strips it). A standard zlib inflate() - as in OpenSSH - decodes it. The client->server direction stays none (OpenSSH compresses outbound with Z_PARTIAL_FLUSH, whose blocks straddle packet byte-boundaries and would need a resumable inflate state machine for a direction - keystrokes / uploads to the device - that barely benefits).
All state and buffers are caller-supplied; the codec allocates nothing. See ssh_zlib.cpp for the work-buffer / hash-table sizing helpers (SSH_ZLIB_* macros).
Definition in file ssh_zlib.h.