Skip to main content

Module frame

Module frame 

Source
Expand description

The SPDY/3.1 frames and their encoding, see https://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3-1/.

Header blocks are compressed with zlib and a preset dictionary. Each direction of a connection keeps one compression context for all its header blocks, so every frame which carries one has to pass the same Decoder or Encoder, also the ones which are otherwise ignored. The server only sends empty header blocks, the Encoder stores them uncompressed in the zlib stream instead of compressing them.

Structsยง

Decoder ๐Ÿ”’
Reads the frames of one direction of a connection.
Encoder ๐Ÿ”’
Writes the frames of one direction of a connection.
Headers ๐Ÿ”’
The headers of a stream. SPDY requires lowercase names, multiple values of a name are joined with NUL bytes.

Enumsยง

Frame ๐Ÿ”’
A single SPDY frame. Only the frames and fields the server acts on are represented, see Frame::Ignored. Its debug output shows only the length of data, which may carry secrets, like typed passwords or forwarded traffic.

Constantsยง

DATA_CHUNK_LEN ๐Ÿ”’
How much of a data frame the server reads at once. Larger frames get handed to their stream in parts, so that the server does not buffer them as a whole. Go clients send 32 KiB per frame.
DICTIONARY ๐Ÿ”’
The preset dictionary for the header compression, from the specification.
DICTIONARY_ID ๐Ÿ”’
The Adler-32 checksum of the dictionary, which the zlib header names.
FLAG_FIN ๐Ÿ”’
The flag which ends the sending side of a stream, on SYN_STREAM, SYN_REPLY, HEADERS and data frames.
GOAWAY_OK ๐Ÿ”’
GOAWAY status: the connection ends normally.
GOAWAY_PROTOCOL_ERROR ๐Ÿ”’
GOAWAY status: the client violated the protocol.
HEADER_LEN ๐Ÿ”’
The length of the common header of all frames.
MAX_CONTROL_FRAME_LEN ๐Ÿ”’
The largest control frame a client may send. The ones Kubernetes clients send carry a few short headers.
MAX_DATA_FRAME_LEN ๐Ÿ”’
The largest frame the protocol allows, its length has 24 bits.
MAX_HEADERS ๐Ÿ”’
The most headers of a stream, Kubernetes clients send up to three. Each takes more memory than the bytes of its block.
MAX_HEADER_BLOCK_LEN ๐Ÿ”’
The largest decompressed header block, which bounds what a small compressed block may expand to. Kubernetes clients send around a hundred bytes, a stream holds its headers as long as it is open. A larger block fails the connection, like any header block which does not decode, the compression context of the connection would be out of sync otherwise.
STATUS_CANCEL ๐Ÿ”’
RST_STREAM status: the stream is not needed anymore. spdystream resets with it as well, also for streams it rejects.
STATUS_PROTOCOL_ERROR ๐Ÿ”’
RST_STREAM status: the frame violates the protocol.
STATUS_REFUSED_STREAM ๐Ÿ”’
RST_STREAM status: the stream got refused before any processing.
TYPE_GOAWAY ๐Ÿ”’
TYPE_HEADERS ๐Ÿ”’
TYPE_PING ๐Ÿ”’
TYPE_RST_STREAM ๐Ÿ”’
TYPE_SYN_REPLY ๐Ÿ”’
TYPE_SYN_STREAM ๐Ÿ”’
VERSION ๐Ÿ”’
The protocol version of the control frames.