Class HPack.Context

Description

Context for an HPack encoder or decoder.

This class implements the majority of RFC 7541.

Functions of interest are typically encode() and decode().


Variable dynamic_headers

protected array(array(string(8bit))) HPack.Context.dynamic_headers

Description

Table of currently available dynamically defined headers.

New entries are appended last, and the first dynamic_prefix elements are not used.

See also

header_index, add_header()


Variable dynamic_max_size

protected int HPack.Context.dynamic_max_size

Description

Current upper size limit in bytes for dynamic_headers.

See also

set_dynamic_size()


Variable dynamic_prefix

protected int HPack.Context.dynamic_prefix

Description

Index of first avaiable header in dynamic_headers.


Variable dynamic_size

protected int HPack.Context.dynamic_size

Description

Current size in bytes of dynamic_headers.


Variable header_index

protected mapping(string(8bit):int|mapping(string(8bit):int)) HPack.Context.header_index

Description

Index into dynamic_headers and static_headers.

"header_name" : mapping(string(8bit):int)|int

Indexed on the header name in lower-case. The value is one of:

int

Index value for the header value "".

mapping(string(8bit):int)
"header_value" : mapping(string(8bit):int)

Index value for the corresponding header value.

The index values in turn are coded as follows:

(1..)

Index into static_header_tab offset by 1.

0

Not used.

(..-1)

Inverted (`~()) index into dynamic_headers.

See also

dynamic_headers, static_header_tab, add_header()


Variable static_max_size

protected int HPack.Context.static_max_size

Description

Static upper size limit in bytes for dynamic_headers.

See also

create(), set_dynamic_size()


Method create

HPack.Context HPack.Context(int|void protocol_dynamic_max_size)

Description

Create a new HPack Context.

Parameter static_max_size

This is the static maximum size in bytes (as calculated by RFC 7541 section 4.1) of the dynamic header table. It defaults to DEFAULT_HEADER_TABLE_SIZE, and is the upper limit for set_dynamic_size().

See also

set_dynamic_size()