| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.QPACK.Internal
Contents
Synopsis
- data DecodeError
- data ApplicationProtocolError where
- pattern QpackDecompressionFailed :: ApplicationProtocolError
- pattern QpackEncoderStreamError :: ApplicationProtocolError
- pattern QpackDecoderStreamError :: ApplicationProtocolError
- data EncoderInstructionError = EncoderInstructionError
- data DecoderInstructionError = DecoderInstructionError
- data RevResult
- duplicate :: DynamicTable -> AbsoluteIndex -> IO AbsoluteIndex
- data DynamicTable
- newDynamicTableForEncoding :: (ByteString -> IO ()) -> IO DynamicTable
- newDynamicTableForDecoding :: Size -> (ByteString -> IO ()) -> IO DynamicTable
- insertRevIndex :: Entry -> AbsoluteIndex -> RevIndex -> IO ()
- lookupRevIndex :: Token -> FieldValue -> RevIndex -> IO RevResult
- lookupRevIndex' :: Token -> FieldValue -> RevResult
- newRevIndex :: IO RevIndex
- renewRevIndex :: RevIndex -> IO ()
- data RevIndex
- getRevIndex :: DynamicTable -> RevIndex
- toDynamicEntry :: DynamicTable -> AbsoluteIndex -> STM Entry
- toIndexedEntry :: DynamicTable -> HIndex -> STM Entry
- isTableReady :: DynamicTable -> IO Bool
- getTableCapacity :: DynamicTable -> IO Int
- setTableCapacity :: DynamicTable -> Int -> IO ()
- getMaxNumOfEntries :: DynamicTable -> IO Int
- insertEntryToDecoder :: Entry -> DynamicTable -> STM AbsoluteIndex
- insertEntryToEncoder :: Entry -> DynamicTable -> IO AbsoluteIndex
- data Section = Section RequiredInsertCount [AbsoluteIndex]
- insertSection :: DynamicTable -> StreamId -> Section -> IO ()
- getAndDelSection :: DynamicTable -> StreamId -> IO (Maybe Section)
- increaseReference :: DynamicTable -> AbsoluteIndex -> IO ()
- decreaseReference :: DynamicTable -> AbsoluteIndex -> IO ()
- getMaxBlockedStreams :: DynamicTable -> IO Int
- setMaxBlockedStreams :: DynamicTable -> Int -> IO ()
- tryIncreaseStreams :: DynamicTable -> IO Bool
- decreaseStreams :: DynamicTable -> IO ()
- insertBlockedStreamE :: DynamicTable -> StreamId -> IO ()
- deleteBlockedStreamE :: DynamicTable -> StreamId -> IO ()
- checkBlockedStreams :: DynamicTable -> IO Bool
- getRequiredInsertCount :: DynamicTable -> IO RequiredInsertCount
- clearRequiredInsertCount :: DynamicTable -> IO ()
- checkRequiredInsertCount :: DynamicTable -> RequiredInsertCount -> IO ()
- checkRequiredInsertCountNB :: DynamicTable -> RequiredInsertCount -> IO Bool
- updateRequiredInsertCount :: DynamicTable -> AbsoluteIndex -> IO ()
- incrementKnownReceivedCount :: DynamicTable -> Int -> IO ()
- updateKnownReceivedCount :: DynamicTable -> RequiredInsertCount -> IO ()
- wouldSectionBeBlocked :: DynamicTable -> RequiredInsertCount -> IO Bool
- wouldInstructionBeBlocked :: DynamicTable -> AbsoluteIndex -> IO Bool
- setInsersionPointToKnownReceivedCount :: DynamicTable -> IO ()
- getBasePoint :: DynamicTable -> IO BasePoint
- setBasePointToInsersionPoint :: DynamicTable -> IO ()
- getInsertionPoint :: DynamicTable -> IO InsertionPoint
- getInsertionPointSTM :: DynamicTable -> STM InsertionPoint
- isDraining :: DynamicTable -> AbsoluteIndex -> IO Bool
- adjustDrainingPoint :: DynamicTable -> IO ()
- checkTailDuplication :: DynamicTable -> IO (Maybe AbsoluteIndex)
- tailDuplication :: DynamicTable -> IO AbsoluteIndex
- tryDrop :: DynamicTable -> IO Bool
- canInsertEntry :: DynamicTable -> Entry -> Maybe AbsoluteIndex -> IO Bool
- getLruCache :: DynamicTable -> LRUCacheRef (FieldName, FieldValue) ()
- getHuffmanDecoder :: DynamicTable -> HuffmanDecoder
- getMaxHeaderSize :: DynamicTable -> IO Int
- setMaxHeaderSize :: DynamicTable -> Int -> IO ()
- qpackDebug :: DynamicTable -> IO () -> IO ()
- getDebugQPACK :: DynamicTable -> IO Bool
- setDebugQPACK :: DynamicTable -> Bool -> IO ()
- printReferences :: DynamicTable -> IO ()
- checkHIndex :: DynamicTable -> HIndex -> IO ()
- checkAbsoluteIndex :: DynamicTable -> AbsoluteIndex -> String -> IO ()
- getImmediateAck :: DynamicTable -> IO Bool
- setImmediateAck :: DynamicTable -> Bool -> IO ()
- deleteRevIndex :: RevIndex -> Entry -> AbsoluteIndex -> IO ()
- tokenToStaticIndex :: Token -> Maybe AbsoluteIndex
- isKeyRegistered :: FieldName -> RevIndex -> IO (Maybe AbsoluteIndex)
- lookupRevIndexS :: Token -> FieldValue -> RevResult
- data HIndex
- data EncoderInstruction
- type InsIndex = Either AbsoluteIndex InsRelativeIndex
- encodeEncoderInstructions :: [EncoderInstruction] -> Bool -> IO ByteString
- decodeEncoderInstructions :: HuffmanDecoder -> ByteString -> IO ([EncoderInstruction], ByteString)
- decodeEncoderInstructions' :: ByteString -> IO ([EncoderInstruction], ByteString)
- encodeEI :: WriteBuffer -> Bool -> EncoderInstruction -> IO ()
- decodeEI :: HuffmanDecoder -> ReadBuffer -> IO EncoderInstruction
- data DecoderInstruction
- encodeDecoderInstructions :: [DecoderInstruction] -> IO ByteString
- decodeDecoderInstructions :: ByteString -> IO ([DecoderInstruction], ByteString)
- encodeDI :: WriteBuffer -> DecoderInstruction -> IO ()
- decodeDI :: ReadBuffer -> IO DecoderInstruction
- encodeHeader :: DynamicTable -> [Header] -> IO (EncodedFieldSection, EncodedEncoderInstruction)
- encodeTokenHeader :: WriteBuffer -> WriteBuffer -> DynamicTable -> TokenHeaderList -> IO [AbsoluteIndex]
- decodeTokenHeader :: DynamicTable -> ReadBuffer -> IO (TokenHeaderTable, Bool)
- type EncodedEncoderInstruction = ByteString
- type EncodedFieldSection = ByteString
- encodePrefix :: WriteBuffer -> DynamicTable -> IO ()
- decodeTokenHeaderS :: DynamicTable -> ReadBuffer -> IO (Maybe ([Header], Bool))
- encodePrefix :: WriteBuffer -> DynamicTable -> IO ()
- decodePrefix :: ReadBuffer -> DynamicTable -> IO (RequiredInsertCount, BasePoint, Bool)
- encodeRequiredInsertCount :: Int -> RequiredInsertCount -> Int
- decodeRequiredInsertCount :: Int -> InsertionPoint -> Int -> RequiredInsertCount
- encodeBase :: RequiredInsertCount -> BasePoint -> (Bool, Int)
- decodeBase :: RequiredInsertCount -> Bool -> Int -> BasePoint
- data HIndex
- newtype AbsoluteIndex = AbsoluteIndex Int
- newtype InsRelativeIndex = InsRelativeIndex Int
- newtype PreBaseIndex = PreBaseIndex Int
- newtype PostBaseIndex = PostBaseIndex Int
- newtype BasePoint = BasePoint Int
- newtype InsertionPoint = InsertionPoint Int
- newtype RequiredInsertCount = RequiredInsertCount Int
- toInsRelativeIndex :: AbsoluteIndex -> InsertionPoint -> InsRelativeIndex
- fromInsRelativeIndex :: InsRelativeIndex -> InsertionPoint -> AbsoluteIndex
- toBaseIndex :: AbsoluteIndex -> BasePoint -> Either PreBaseIndex PostBaseIndex
- toPreBaseIndex :: AbsoluteIndex -> BasePoint -> PreBaseIndex
- fromPreBaseIndex :: PreBaseIndex -> BasePoint -> AbsoluteIndex
- toPostBaseIndex :: AbsoluteIndex -> BasePoint -> PostBaseIndex
- fromPostBaseIndex :: PostBaseIndex -> BasePoint -> AbsoluteIndex
- type Setter = Word8 -> Word8
- set1 :: Setter
- set01 :: Setter
- set10 :: Setter
- set11 :: Setter
- set001 :: Setter
- set0001 :: Setter
- set0100 :: Setter
- set0101 :: Setter
- set0010 :: Setter
- set00000 :: Setter
- set00001 :: Setter
- set0 :: Setter
- set00 :: Setter
- set000 :: Setter
- set0000 :: Setter
Documentation
data DecodeError Source #
Instances
| Exception DecodeError Source # | |
Defined in Network.QPACK.Error Methods toException :: DecodeError -> SomeException # fromException :: SomeException -> Maybe DecodeError # displayException :: DecodeError -> String # | |
| Show DecodeError Source # | |
Defined in Network.QPACK.Error Methods showsPrec :: Int -> DecodeError -> ShowS # show :: DecodeError -> String # showList :: [DecodeError] -> ShowS # | |
| Eq DecodeError Source # | |
Defined in Network.QPACK.Error | |
data ApplicationProtocolError where #
Application protocol errors of QUIC.
Bundled Patterns
| pattern QpackDecompressionFailed :: ApplicationProtocolError | |
| pattern QpackEncoderStreamError :: ApplicationProtocolError | |
| pattern QpackDecoderStreamError :: ApplicationProtocolError |
Instances
| Show ApplicationProtocolError | |
Defined in Network.QUIC.Types.Error Methods showsPrec :: Int -> ApplicationProtocolError -> ShowS # show :: ApplicationProtocolError -> String # showList :: [ApplicationProtocolError] -> ShowS # | |
| Eq ApplicationProtocolError | |
Defined in Network.QUIC.Types.Error Methods (==) :: ApplicationProtocolError -> ApplicationProtocolError -> Bool # (/=) :: ApplicationProtocolError -> ApplicationProtocolError -> Bool # | |
data EncoderInstructionError Source #
Constructors
| EncoderInstructionError |
Instances
| Exception EncoderInstructionError Source # | |
Defined in Network.QPACK.Error | |
| Show EncoderInstructionError Source # | |
Defined in Network.QPACK.Error Methods showsPrec :: Int -> EncoderInstructionError -> ShowS # show :: EncoderInstructionError -> String # showList :: [EncoderInstructionError] -> ShowS # | |
| Eq EncoderInstructionError Source # | |
Defined in Network.QPACK.Error Methods (==) :: EncoderInstructionError -> EncoderInstructionError -> Bool # (/=) :: EncoderInstructionError -> EncoderInstructionError -> Bool # | |
data DecoderInstructionError Source #
Constructors
| DecoderInstructionError |
Instances
| Exception DecoderInstructionError Source # | |
Defined in Network.QPACK.Error | |
| Show DecoderInstructionError Source # | |
Defined in Network.QPACK.Error Methods showsPrec :: Int -> DecoderInstructionError -> ShowS # show :: DecoderInstructionError -> String # showList :: [DecoderInstructionError] -> ShowS # | |
| Eq DecoderInstructionError Source # | |
Defined in Network.QPACK.Error Methods (==) :: DecoderInstructionError -> DecoderInstructionError -> Bool # (/=) :: DecoderInstructionError -> DecoderInstructionError -> Bool # | |
duplicate :: DynamicTable -> AbsoluteIndex -> IO AbsoluteIndex Source #
data DynamicTable Source #
Dynamic table for QPACK.
newDynamicTableForEncoding :: (ByteString -> IO ()) -> IO DynamicTable Source #
Creating DynamicTable for encoding.
newDynamicTableForDecoding Source #
Arguments
| :: Size | The size of temporary buffer for Huffman decoding |
| -> (ByteString -> IO ()) | |
| -> IO DynamicTable |
Creating DynamicTable for decoding.
insertRevIndex :: Entry -> AbsoluteIndex -> RevIndex -> IO () Source #
lookupRevIndex :: Token -> FieldValue -> RevIndex -> IO RevResult Source #
lookupRevIndex' :: Token -> FieldValue -> RevResult Source #
newRevIndex :: IO RevIndex Source #
renewRevIndex :: RevIndex -> IO () Source #
getRevIndex :: DynamicTable -> RevIndex Source #
toDynamicEntry :: DynamicTable -> AbsoluteIndex -> STM Entry Source #
toIndexedEntry :: DynamicTable -> HIndex -> STM Entry Source #
isTableReady :: DynamicTable -> IO Bool Source #
getTableCapacity :: DynamicTable -> IO Int Source #
setTableCapacity :: DynamicTable -> Int -> IO () Source #
getMaxNumOfEntries :: DynamicTable -> IO Int Source #
insertEntryToDecoder :: Entry -> DynamicTable -> STM AbsoluteIndex Source #
insertEntryToEncoder :: Entry -> DynamicTable -> IO AbsoluteIndex Source #
Constructors
| Section RequiredInsertCount [AbsoluteIndex] |
insertSection :: DynamicTable -> StreamId -> Section -> IO () Source #
getAndDelSection :: DynamicTable -> StreamId -> IO (Maybe Section) Source #
increaseReference :: DynamicTable -> AbsoluteIndex -> IO () Source #
decreaseReference :: DynamicTable -> AbsoluteIndex -> IO () Source #
getMaxBlockedStreams :: DynamicTable -> IO Int Source #
setMaxBlockedStreams :: DynamicTable -> Int -> IO () Source #
tryIncreaseStreams :: DynamicTable -> IO Bool Source #
decreaseStreams :: DynamicTable -> IO () Source #
insertBlockedStreamE :: DynamicTable -> StreamId -> IO () Source #
deleteBlockedStreamE :: DynamicTable -> StreamId -> IO () Source #
checkBlockedStreams :: DynamicTable -> IO Bool Source #
clearRequiredInsertCount :: DynamicTable -> IO () Source #
checkRequiredInsertCount :: DynamicTable -> RequiredInsertCount -> IO () Source #
updateRequiredInsertCount :: DynamicTable -> AbsoluteIndex -> IO () Source #
incrementKnownReceivedCount :: DynamicTable -> Int -> IO () Source #
updateKnownReceivedCount :: DynamicTable -> RequiredInsertCount -> IO () Source #
getBasePoint :: DynamicTable -> IO BasePoint Source #
setBasePointToInsersionPoint :: DynamicTable -> IO () Source #
isDraining :: DynamicTable -> AbsoluteIndex -> IO Bool Source #
adjustDrainingPoint :: DynamicTable -> IO () Source #
canInsertEntry :: DynamicTable -> Entry -> Maybe AbsoluteIndex -> IO Bool Source #
getLruCache :: DynamicTable -> LRUCacheRef (FieldName, FieldValue) () Source #
getMaxHeaderSize :: DynamicTable -> IO Int Source #
setMaxHeaderSize :: DynamicTable -> Int -> IO () Source #
qpackDebug :: DynamicTable -> IO () -> IO () Source #
getDebugQPACK :: DynamicTable -> IO Bool Source #
setDebugQPACK :: DynamicTable -> Bool -> IO () Source #
printReferences :: DynamicTable -> IO () Source #
checkHIndex :: DynamicTable -> HIndex -> IO () Source #
checkAbsoluteIndex :: DynamicTable -> AbsoluteIndex -> String -> IO () Source #
getImmediateAck :: DynamicTable -> IO Bool Source #
setImmediateAck :: DynamicTable -> Bool -> IO () Source #
deleteRevIndex :: RevIndex -> Entry -> AbsoluteIndex -> IO () Source #
isKeyRegistered :: FieldName -> RevIndex -> IO (Maybe AbsoluteIndex) Source #
lookupRevIndexS :: Token -> FieldValue -> RevResult Source #
Constructors
| SIndex AbsoluteIndex | |
| DIndex AbsoluteIndex |
data EncoderInstruction Source #
Constructors
| SetDynamicTableCapacity Int | |
| InsertWithNameReference InsIndex FieldValue | |
| InsertWithLiteralName Token FieldValue | |
| Duplicate InsRelativeIndex |
Instances
| Show EncoderInstruction Source # | |
Defined in Network.QPACK.Instruction Methods showsPrec :: Int -> EncoderInstruction -> ShowS # show :: EncoderInstruction -> String # showList :: [EncoderInstruction] -> ShowS # | |
| Eq EncoderInstruction Source # | |
Defined in Network.QPACK.Instruction Methods (==) :: EncoderInstruction -> EncoderInstruction -> Bool # (/=) :: EncoderInstruction -> EncoderInstruction -> Bool # | |
encodeEncoderInstructions :: [EncoderInstruction] -> Bool -> IO ByteString Source #
decodeEncoderInstructions :: HuffmanDecoder -> ByteString -> IO ([EncoderInstruction], ByteString) Source #
encodeEI :: WriteBuffer -> Bool -> EncoderInstruction -> IO () Source #
decodeEI :: HuffmanDecoder -> ReadBuffer -> IO EncoderInstruction Source #
data DecoderInstruction Source #
Instances
| Show DecoderInstruction Source # | |
Defined in Network.QPACK.Instruction Methods showsPrec :: Int -> DecoderInstruction -> ShowS # show :: DecoderInstruction -> String # showList :: [DecoderInstruction] -> ShowS # | |
| Eq DecoderInstruction Source # | |
Defined in Network.QPACK.Instruction Methods (==) :: DecoderInstruction -> DecoderInstruction -> Bool # (/=) :: DecoderInstruction -> DecoderInstruction -> Bool # | |
encodeDI :: WriteBuffer -> DecoderInstruction -> IO () Source #
encodeHeader :: DynamicTable -> [Header] -> IO (EncodedFieldSection, EncodedEncoderInstruction) Source #
Encoding headers with QPACK.
Header block with prefix and instructions are returned.
2048, 32, and 2048 bytes-buffers are
temporally allocated for header block, prefix and encoder instructions.
If headers are too large, BufferOverrun is thrown.
Arguments
| :: WriteBuffer | Workspace for the body of header block |
| -> WriteBuffer | Workspace for encoder instructions |
| -> DynamicTable | |
| -> TokenHeaderList | |
| -> IO [AbsoluteIndex] |
Converting TokenHeaderList to the QPACK format.
TokenHeaderList must be smaller than or equal to workspaces.
Otherwise, BufferOverrun is thrown.
decodeTokenHeader :: DynamicTable -> ReadBuffer -> IO (TokenHeaderTable, Bool) Source #
type EncodedEncoderInstruction = ByteString Source #
Encoded encoder instruction.
type EncodedFieldSection = ByteString Source #
Encoded field section including prefix.
encodePrefix :: WriteBuffer -> DynamicTable -> IO () Source #
Encoding the prefix part of header block.
This should be used after encodeTokenHeader.
decodeTokenHeaderS :: DynamicTable -> ReadBuffer -> IO (Maybe ([Header], Bool)) Source #
encodePrefix :: WriteBuffer -> DynamicTable -> IO () Source #
Encoding the prefix part of header block.
This should be used after encodeTokenHeader.
decodePrefix :: ReadBuffer -> DynamicTable -> IO (RequiredInsertCount, BasePoint, Bool) Source #
Decoding the prefix part of header block.
encodeRequiredInsertCount :: Int -> RequiredInsertCount -> Int Source #
>>>encodeRequiredInsertCount 3 94>>>encodeRequiredInsertCount 128 1000233
decodeRequiredInsertCount :: Int -> InsertionPoint -> Int -> RequiredInsertCount Source #
for decoder
>>>decodeRequiredInsertCount 3 10 4RequiredInsertCount 9>>>decodeRequiredInsertCount 128 990 233RequiredInsertCount 1000
encodeBase :: RequiredInsertCount -> BasePoint -> (Bool, Int) Source #
>>>encodeBase 6 9(False,3)>>>encodeBase 9 6(True,2)
decodeBase :: RequiredInsertCount -> Bool -> Int -> BasePoint Source #
>>>decodeBase 6 False 3BasePoint 9>>>decodeBase 9 True 2BasePoint 6
Types
Constructors
| SIndex AbsoluteIndex | |
| DIndex AbsoluteIndex |
newtype AbsoluteIndex Source #
Constructors
| AbsoluteIndex Int |
Instances
newtype InsRelativeIndex Source #
Constructors
| InsRelativeIndex Int |
Instances
newtype PreBaseIndex Source #
Constructors
| PreBaseIndex Int |
Instances
newtype PostBaseIndex Source #
Constructors
| PostBaseIndex Int |
Instances
Instances
| Num BasePoint Source # | |
Defined in Network.QPACK.Types | |
| Show BasePoint Source # | |
| Eq BasePoint Source # | |
| Ord BasePoint Source # | |
newtype InsertionPoint Source #
Constructors
| InsertionPoint Int |
Instances
newtype RequiredInsertCount Source #
Constructors
| RequiredInsertCount Int |
Instances
toInsRelativeIndex :: AbsoluteIndex -> InsertionPoint -> InsRelativeIndex Source #
>>>toInsRelativeIndex 99 100InsRelativeIndex 0>>>toInsRelativeIndex 98 100InsRelativeIndex 1>>>toInsRelativeIndex 97 100InsRelativeIndex 2>>>toInsRelativeIndex 96 100InsRelativeIndex 3
fromInsRelativeIndex :: InsRelativeIndex -> InsertionPoint -> AbsoluteIndex Source #
>>>fromInsRelativeIndex 0 100AbsoluteIndex 99>>>fromInsRelativeIndex 1 100AbsoluteIndex 98>>>fromInsRelativeIndex 2 100AbsoluteIndex 97>>>fromInsRelativeIndex 3 100AbsoluteIndex 96
toPreBaseIndex :: AbsoluteIndex -> BasePoint -> PreBaseIndex Source #
>>>toPreBaseIndex 96 98PreBaseIndex 1>>>toPreBaseIndex 97 98PreBaseIndex 0
fromPreBaseIndex :: PreBaseIndex -> BasePoint -> AbsoluteIndex Source #
>>>fromPreBaseIndex 1 98AbsoluteIndex 96>>>fromPreBaseIndex 0 98AbsoluteIndex 97
toPostBaseIndex :: AbsoluteIndex -> BasePoint -> PostBaseIndex Source #
>>>toPostBaseIndex 98 98PostBaseIndex 0>>>toPostBaseIndex 99 98PostBaseIndex 1
fromPostBaseIndex :: PostBaseIndex -> BasePoint -> AbsoluteIndex Source #
>>>fromPostBaseIndex 0 98AbsoluteIndex 98>>>fromPostBaseIndex 1 98AbsoluteIndex 99