DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
inflate.h File Reference

Bounded RFC 1951 DEFLATE decompressor (INFLATE) - no heap. More...

#include "ServerConfig.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

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).

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file inflate.h.