http2-0.1.0: HTTP/2.0 library including HPACK

Safe HaskellNone

Network.HPACK.Context

Contents

Synopsis

Types

type HeaderSet = [Header]Source

Header set.

data Context Source

Context for encoding/decoding.

newContext :: Size -> IO ContextSource

Creating a new Context. The first argument is the size of HeaderTable.

data DecodeError Source

Errors for decoder.

Constructors

IndexOverrun Index

Index is out of range

EosInTheMiddle

Eos appears in the middle of string

IllegalEos

Non-eos appears in the end of string

TooLongEos

Eos is more than 7 bits

EmptyEncodedString

Encoded string has no length

EmptyBlock

Header block is empty

Initialization and final results

clearHeaderSet :: Context -> ContextSource

Clearing HeaderSet in Context for the next decode.

getHeaderSet :: Context -> HeaderSetSource

Getting HeaderSet as emitted headers.

emitNotEmitted :: Context -> IO ContextSource

Emitting non-emitted headers.

Processing

clearRefSets :: Context -> IO ContextSource

The reference set is emptied.

removeRef :: Context -> Index -> IO ContextSource

The entry is removed from the reference set.

newEntry :: Context -> Entry -> IO ContextSource

The header field is emitted. The header field is inserted at the beginning of the header table. A reference to the new entry is added to the reference set.

pushRef :: Context -> Index -> Entry -> IO ContextSource

The header field corresponding to the referenced entry is emitted. The referenced header table entry is added to the reference set.

emitOnly :: Context -> Header -> IO ContextSource

The header field is emitted.

Auxiliary functions

isPresentIn :: Index -> Context -> BoolSource

Is Index present in the reference set?

Table

whichTable :: Index -> Context -> IO (WhichTable, Entry)Source

Which table does Index refer to?

lookupHeader :: Header -> Context -> IO HeaderCacheSource

Which table contains Header?