Skip to content

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.

new QpackDecoder(options): QpackDecoder

Defined in: packages/format-http/src/qpack/qpack-decoder.ts:63

QpackDecoderOptions

QpackDecoder

get insertCount(): number

Defined in: packages/format-http/src/qpack/qpack-decoder.ts:68

Entries ever inserted into the dynamic table.

number

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.

number

void


decode(streamId, section): HpackField[] | null

Defined in: packages/format-http/src/qpack/qpack-decoder.ts:131

Decode one complete field section received on streamId.

number

Uint8Array

HpackField[] | null

The fields in order, or null when the section waits for table entries not received yet.

QPACK_DECOMPRESSION_FAILED when the section is invalid or too many streams are blocked; the connection must close.

When the fields exceed maxFieldSectionSize; only the stream fails.


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.

Uint8Array

number[]

Streams whose blocked field section can now be decoded.

QPACK_ENCODER_STREAM_ERROR when an instruction is invalid; the connection must close.


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.

Uint8Array<ArrayBuffer> | null