Skip to main content

Module decode

Module decode 

Source
Expand description

Decoding a header block.

The five representations of RFC 7541 section 6, distinguished by the top bits of the first byte:

1xxxxxxx   indexed header field                    (7-bit prefix)
01xxxxxx   literal, incremental indexing           (6-bit prefix)
001xxxxx   dynamic table size update               (5-bit prefix)
0001xxxx   literal, never indexed                  (4-bit prefix)
0000xxxx   literal, without indexing               (4-bit prefix)

The order matters: 0001xxxx must be tested before 0000xxxx, and the size update before both. Getting the prefix lengths wrong misreads the integer that follows, which then consumes the wrong number of bytes and desynchronises the rest of the block.

Re-exports§

pub use static_table::DYNAMIC_BASE;
pub use static_table::ENTRIES as STATIC_ENTRIES;

Structs§

Decoder
Decodes header blocks, carrying the dynamic table between them.
Header
One decoded header.

Constants§

MAX_STRING
The longest header name or value this decoder will materialise.

Functions§

decode_integer
RFC 7541 section 5.1: an integer with an n-bit prefix, continued in seven-bit groups when the prefix is all ones.