|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
Bounded RFC 1951 DEFLATE decompressor (INFLATE) - no heap. More...
Go to the source code of this file.
Bounded RFC 1951 DEFLATE decompressor (INFLATE) - no heap.
A small, host-testable INFLATE used by WebSocket permessage-deflate (RFC 7692). It decompresses a raw DEFLATE stream (no zlib/gzip wrapper) into a caller buffer. LZ77 back-references read from the output buffer itself, so there is no separate sliding window - the output buffer is the window. That is correct for permessage-deflate's no_context_takeover mode (each message is independent) and bounds memory: a decompressed message must fit dst_cap.
The only working memory is a Huffman-table scratch the caller supplies (INFLATE_SCRATCH_SIZE bytes); the WebSocket layer borrows it from the per-dispatch scratch arena, so INFLATE costs no dedicated buffer.
Decoding terminates at a final block (BFINAL) or at a clean end-of-input on a block boundary - so it accepts a permessage-deflate payload, which carries no final block (the caller appends the 0x00 0x00 0xff 0xff marker per RFC 7692 §7.2.2 before calling).
Definition in file inflate.h.