Expand description
Encoding a header block.
Deliberately the simplest legal encoder. Every header goes out either as a bare static-table index, when name and value match one exactly, or as a literal without indexing — never Huffman-coded, never entered into a table.
§Why give up the compression
Because the alternative is the hardest bug in HPACK. An encoder that indexes has to keep a table in lockstep with the peer’s copy of it, and a divergence does not fail: it makes the peer read subsequent headers as different headers. There is nothing to diverge here.
The cost is bytes on a connection that carries two request shapes, both of them tiny next to the map responses coming back the other way. That is a good trade for a class of bug that would be very hard to find.
Functions§
- encode_
header - Append a header to
out, returning the new length. - encode_
integer - RFC 7541 section 5.1, with
flagssupplying the bits above the prefix.