Type for dynamic table.
Modulehttp2-5.4.8Haskell2010
Network.HPACK.Table
- 7 types
- 31 values
- Packagehttp2-5.4.8
- Exports38
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceDynamic.hs
dynamic table
14 declarationsCreating DynamicTable for encoding.
newDynamicTableForDecoding :: SizeThe dynamic table size
-> SizeThe size of temporary buffer for Huffman decoding. A longer value is decoded in a buffer of its own.
-> IO DynamicTable
Creating DynamicTable for decoding.
Creating DynamicTable for encoding, performing the action and clearing the DynamicTable.
withDynamicTableForDecoding :: SizeThe dynamic table size
-> SizeThe size of temporary buffer for Huffman decoding. A longer value is decoded in a buffer of its own.
-> (DynamicTable -> IO a)-> IO a
Creating DynamicTable for decoding, performing the action and clearing the DynamicTable.
Renewing DynamicTable with necessary entries copied.
Printing DynamicTable.
When SETTINGS_HEADER_TABLE_SIZE is received from a peer, its value should be set by this function.
Insertion
1 declarationInserting Entry to DynamicTable.
Entries are evicted first and the new one added after, as RFC 7541 section 4.4 has it: "Before a new entry is added to the dynamic table, entries are evicted from the end of the dynamic table until the size of the dynamic table is less than or equal to (maximum size - new entry size) or until the table is empty." An entry larger than the table empties it and is not added.
The order matters to the ring. It has room for maxNumbers entries, and the table holds that many whenever they are all close to the 32-octet minimum -- at a size of 40 or 100, say. Added first, the new entry landed on the oldest one's slot, and the eviction that followed read that slot back and took out the new entry instead, leaving a dummy. After evicting there is always a free slot: every entry is 32 octets or more, so the entries left and the new one come to at most maxNumbers.
Entry
13 declarationsDummy Entry to initialize a dynamic table.
Getting FieldValue.
Getting HeaderName.
Getting the size of Entry.
Getting Token.
Getting TokenHeader.
How many entries can be stored in a dynamic table?
Field value.
Type for table entry. Size includes the 32 bytes magic number.
Constructors
Size in bytes.
Index for table.