Skip to content

blackbull.protocol.frame_types

blackbull.protocol.frame_types

HTTP/2 frame type definitions (RFC 7540 §6, RFC 9113).

Frame-type classes, enums, and the FrameBase registry. HPACK compression/decompression is delegated to the hpack library.

FrameFactory lives in frame.py; this module is kept free of factory / parsing logic so the type hierarchy can be imported without pulling in the codec.

Continuation

Bases: FrameBase

docstring for Continuation

Data

Bases: FrameBase

docstring for Data

FrameBase

docstring for FrameBase

FrameFlags

Bases: IntEnum

Common base for all HTTP/2 frame flag enums.

Inheriting from this empty base allows type annotations to reference FrameFlags instead of listing every concrete flag enum. Because FrameFlags itself has no members, Python's restriction on subclassing a non-empty IntEnum does not apply.

GoAway

Bases: FrameBase

RFC 9113 §6.8 — GOAWAY frame.

The frame's stream identifier (set by FrameBase) MUST be 0; this is a connection-level frame. The first 4 bytes of the payload are the last_stream_id (a separate field) and the next 4 bytes are the error code. Earlier revisions of this class assigned the payload's last_stream_id back into self.stream_id, which made every outgoing GOAWAY ship with the wrong frame header — h2spec saw a malformed GOAWAY and reported "Error: connection error: PROTOCOL_ERROR" instead of accepting the GOAWAY for the connection-error tests.

Headers

Bases: FrameBase

Ping

Bases: FrameBase

docstring for Ping

PriorityUpdate

Bases: FrameBase

RFC 9218 §7.1 — PRIORITY_UPDATE frame (type 0x10).

Payload: 4-byte Prioritized Stream ID + ASCII Priority field value (e.g. u=3 or u=0, i). The server receives and logs the hint but does not reorder stream processing.

PseudoHeaders

Bases: StrEnum

RFC 7540 §8.1.2 pseudo-header field names.

PushPromise

Bases: FrameBase

RFC 7540 §6.6 — PUSH_PROMISE frame (type 0x05).

Sent on the initiating (parent) stream; carries the promised stream ID and the HPACK-encoded synthetic request headers for the pushed resource.

SettingFrame

Bases: FrameBase

docstring for SettingFrame

WindowUpdate

Bases: FrameBase

docstring for WindowUpdate

parse_priority_field(s)

Parse an RFC 9218 Priority field value string.

"u=5, i"{'urgency': 5, 'incremental': True}

Defaults per RFC 9218 §4.1: urgency=3, incremental=False.