Skip to content

blackbull.server.http2_connection

blackbull.server.http2_connection

The HTTP/2 connection core (RFC 9113) that the server and the client share.

HTTP2Connection admits frames by stream state, assembles field blocks, answers SETTINGS, PING, WINDOW_UPDATE, PRIORITY, RST_STREAM and GOAWAY, and decides the error scope. A role subclasses it and supplies what a stream means to it; the rules that differ by role are in the role policy section.

HTTP2Connection

One endpoint of an HTTP/2 connection, either role.

A role sets _PEER_PARITY (the parity of the stream ids the peer opens) and implements the hooks: _send_control, _reset, _after_goaway, _retire_all, _peer_reset, _peer_goaway, _open_peer_stream, _on_push_promise and _field_block_refused.

on_ping(frame) async

§6.7: answer with the ACK; an ACK is the answer to ours.

on_priority(frame) async

§5.3.1: a stream cannot depend on itself.

on_rst_stream(frame, stream) async

§6.4: an RST_STREAM on an idle stream is a connection error.

on_settings(frame) async

§6.5: validate every parameter, then apply them and ACK.

on_window_update(frame) async

§6.9: credit the connection or one stream; zero and overflow are errors at the level they arrived on.