decodeI :: IntN+
-> Word8The head of encoded integer whose prefix is already dropped
-> ReadBuffer-> IO Int
Integer decoding with a read buffer. The first argument is N of prefix.
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11
Modulehttp2-5.4.8Haskell2010
decodeI :: IntN+
-> Word8The head of encoded integer whose prefix is already dropped
-> ReadBuffer-> IO IntInteger decoding with a read buffer. The first argument is N of prefix.
decodeInteger :: IntN+
-> Word8The head of encoded integer whose prefix is already dropped
-> ByteStringThe tail of encoded integer
-> IO IntInteger decoding. The first argument is N of prefix.
decodeInteger 5 10 $ BS.empty10decodeInteger 5 31 $ BS.pack [154,10]1337decodeInteger 8 42 $ BS.empty42
Integer encoding with a write buffer.
Encoding integer with a temporary buffer whose size is 4096. No prefix is set.
BS.unpack <$> encodeInteger 5 10[10]BS.unpack <$> encodeInteger 5 1337[31,154,10]BS.unpack <$> encodeInteger 8 42[42]
The largest integer decodeI will return.
HPACK's integer encoding carries no bound of its own, so a decoder has to impose one. RFC 7541, section 5.1: "Integer encodings that exceed implementation limits -- in value or octet length -- MUST be treated as decoding errors."
2^30 - 1 is far above anything HTTP/2 can ask for -- a frame payload is at most 2^24 - 1 octets, so no length or index comes near it -- and it still fits in an Int on a platform where that is 32 bits wide.
integerLimit1073741823
encodeS :: WriteBuffer-> BoolUse Huffman if efficient
-> (Word8 -> Word8)Setting prefix
-> (Word8 -> Word8)Setting huffman flag
-> IntN+
-> ByteStringTarget
-> IO ()String encoding. The algorithm based on copy avoidance and selection of better result of huffman or raw.
String encoding (7+) with a temporary buffer whose size is 4096.
decodeS :: (Word8 -> Word8)Dropping prefix and Huffman
-> (Word8 -> Bool)Checking Huffman flag
-> IntN+
-> HuffmanDecoder-> ReadBuffer-> IO ByteStringString decoding with Huffman decoder.
Converting to '[Header]'.
Headers are decoded as is.
DecodeError would be thrown if the HPACK format is broken.
Converting to TokenHeaderList and ValueTable.
Multiple values of Cookie: are concatenated.
If a pseudo header appears multiple times, IllegalHeaderName is thrown.
If unknown pseudo headers appear, IllegalHeaderName is thrown.
If pseudo headers are found after normal headers, IllegalHeaderName is thrown.
If a header key contains capital letters, IllegalHeaderName is thrown.
If the number of header fields is too large, TooLargeHeader is thrown
IllegalHeaderName and TooLargeHeader are thrown only once the whole block has been decoded, so that the dynamic table is up to date: the message is malformed, not the block.
DecodeError would be thrown if the HPACK format is broken.
String decoding (7+) with a temporal Huffman decoder whose buffer is 4096.
Converting a header list of the http-types style to TokenHeaderList and ValueTable.
Low devel Huffman decoding in a write buffer.
decodeH :: GCBufferA working space
-> BufferSize-> ReadBufferA read buffer which contains the target
-> IntThe target length
-> IO ByteStringHuffman decoding.
Huffman decoding.
Huffman encoding.
Huffman encoding with a temporary buffer whose size is 4096.
Huffman decoding.
Dummy 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.
Size in bytes.
Index for table.
Compression algorithms for HPACK encoding.
Eq CompressionAlgoDefined in http2-5.4.8 · Network.HPACK.TypesShow CompressionAlgoDefined in http2-5.4.8 · Network.HPACK.TypesStrategy for HPACK encoding.
EncodeStrategycompressionAlgo :: CompressionAlgoWhich compression algorithm is used.
useHuffman :: BoolWhether or not to use Huffman encoding for strings.
Eq EncodeStrategyDefined in http2-5.4.8 · Network.HPACK.TypesShow EncodeStrategyDefined in http2-5.4.8 · Network.HPACK.Types