Integer encoding with a write buffer.
Modulehttp2-5.3.10Haskell2010
Network.HPACK.Internal
- 8 types
- 25 values
- Packagehttp2-5.3.10
- Exports33
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceInteger.hs
Integer encoding/decoding
4 declarationsEncoding 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]
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.
decodeInteger :: IntN+
-> Word8The head of encoded integer whose prefix is already dropped
-> ByteStringThe tail of encoded integer
-> IO Int
Integer decoding. The first argument is N of prefix.
decodeInteger 5 10 $ BS.empty10decodeInteger 5 31 $ BS.pack [154,10]1337decodeInteger 8 42 $ BS.empty42
String encoding/decoding
27 declarationsencodeS :: 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.
Converting a header list of the http-types style to TokenHeaderList and ValueTable.
decodeS :: (Word8 -> Word8)Dropping prefix and Huffman
-> (Word8 -> Bool)Checking Huffman flag
-> IntN+
-> HuffmanDecoder-> ReadBuffer-> IO ByteString
String decoding with Huffman decoder.
Converting to '[Header]'.
Headers are decoded as is.
DecodeError would be thrown if the HPACK format is broken.
BufferOverrun will be thrown if the temporary buffer for Huffman decoding is too small.
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
DecodeError would be thrown if the HPACK format is broken.
BufferOverrun will be thrown if the temporary buffer for Huffman decoding is too small.
String decoding (7+) with a temporal Huffman decoder whose buffer is 4096.
Huffman encoding.
Huffman encoding with a temporary buffer whose size is 4096.
decodeH :: GCBufferA working space
-> BufferSize-> ReadBufferA read buffer which contains the target
-> IntThe target length
-> IO ByteString
Huffman decoding.
Huffman decoding with a temporary buffer whose size is 4096.
Huffman decoding.
Low devel Huffman decoding in a write buffer.
Field value.
Size in bytes.
Index for table.
Type for table entry. Size includes the 32 bytes magic number.
Constructors
Getting the size of Entry.
Getting TokenHeader.
Getting Token.
Getting HeaderName.
Getting FieldValue.
Dummy Entry to initialize a dynamic table.
How many entries can be stored in a dynamic table?
Types
2 declarationsCompression algorithms for HPACK encoding.
Instances2Eq, Show
Eq CompressionAlgoDefined in http2-5.3.10 · Network.HPACK.TypesShow CompressionAlgoDefined in http2-5.3.10 · Network.HPACK.Types
Strategy for HPACK encoding.
Constructors
EncodeStrategycompressionAlgo :: CompressionAlgoWhich compression algorithm is used.
useHuffman :: BoolWhether or not to use Huffman encoding for strings.
Instances2Eq, Show
Eq EncodeStrategyDefined in http2-5.3.10 · Network.HPACK.TypesShow EncodeStrategyDefined in http2-5.3.10 · Network.HPACK.Types