Skip to main content

Module qpack

Module qpack 

Source
Expand description

QPACK, the field compression of HTTP/3 (RFC 9204), with the static table only.

An endpoint that advertises SETTINGS_QPACK_MAX_TABLE_CAPACITY = 0 never has a dynamic table, needs neither an encoder nor a decoder stream (RFC 9204 §4.2), and every field section it receives must have a Required Insert Count of 0. So decode_field_section refuses every reference to a dynamic table as "dynamic table reference", which a connection maps onto QPACK_DECOMPRESSION_FAILED, and encode_field_section writes only static references and literals.

Strategy of the encoder, fixed:

  • a field found whole in the static table is an indexed field line;
  • a field whose name is in the static table is a literal with a name reference;
  • anything else is a literal with a literal name;
  • a sensitive field (the flag, or is_sensitive) sets the N bit, so an intermediary never puts it into a dynamic table (RFC 9204 §7.1.3);
  • a string is Huffman-coded when that is strictly shorter.

Constants§

STATIC
The static table, Appendix A: index 0 is the first entry.

Functions§

decode_field_section
Decodes one complete field section, appending (name, value) pairs to out in order.
encode_field_section
Encodes one field section against the static table only. Each field is (name, value, sensitive); names must already be lowercase.