QpackDecoder
Defined in: packages/format-http/src/qpack/qpack-decoder.ts:55
Decodes QPACK field sections (RFC 9204) for one HTTP/3 connection, keeping the dynamic table the peer’s encoder fills through its encoder stream.
Sans-I/O: the caller feeds the peer’s encoder stream to
receiveEncoderInstructions, decodes each HEADERS frame’s payload with
decode, and sends what takeInstructions returns on its own
decoder stream. A section referring to entries not yet received is blocked:
decode returns null, and the caller decodes it again once
receiveEncoderInstructions reports its stream.
Decoding is O(n) in the section size plus the decoded output, which
maxFieldSectionSize bounds.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new QpackDecoder(
options):QpackDecoder
Defined in: packages/format-http/src/qpack/qpack-decoder.ts:63
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”QpackDecoder
Accessors
Section titled “Accessors”insertCount
Section titled “insertCount”Get Signature
Section titled “Get Signature”get insertCount():
number
Defined in: packages/format-http/src/qpack/qpack-decoder.ts:68
Entries ever inserted into the dynamic table.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”cancelStream()
Section titled “cancelStream()”cancelStream(
streamId):void
Defined in: packages/format-http/src/qpack/qpack-decoder.ts:147
The stream was reset, or its reading abandoned, before its field sections were all decoded: forget a blocked one and tell the encoder (Stream Cancellation), so it can release the entries they refer to.
Parameters
Section titled “Parameters”streamId
Section titled “streamId”number
Returns
Section titled “Returns”void
decode()
Section titled “decode()”decode(
streamId,section):HpackField[] |null
Defined in: packages/format-http/src/qpack/qpack-decoder.ts:131
Decode one complete field section received on streamId.
Parameters
Section titled “Parameters”streamId
Section titled “streamId”number
section
Section titled “section”Uint8Array
Returns
Section titled “Returns”HpackField[] | null
The fields in order, or null when the section waits for table
entries not received yet.
Throws
Section titled “Throws”QPACK_DECOMPRESSION_FAILED when the section is
invalid or too many streams are blocked; the connection must close.
Throws
Section titled “Throws”When the fields exceed
maxFieldSectionSize; only the stream fails.
receiveEncoderInstructions()
Section titled “receiveEncoderInstructions()”receiveEncoderInstructions(
chunk):number[]
Defined in: packages/format-http/src/qpack/qpack-decoder.ts:79
Apply instructions from the peer’s encoder stream, in any chunking.
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”number[]
Streams whose blocked field section can now be decoded.
Throws
Section titled “Throws”QPACK_ENCODER_STREAM_ERROR when an instruction is
invalid; the connection must close.
takeInstructions()
Section titled “takeInstructions()”takeInstructions():
Uint8Array<ArrayBuffer> |null
Defined in: packages/format-http/src/qpack/qpack-decoder.ts:156
Decoder stream bytes to send, or null when there are none.
Returns
Section titled “Returns”Uint8Array<ArrayBuffer> | null