Ace.HTTP2.Frame (ace v0.19.0) View Source

Basic protocol unit of HTTP/2.

All frames begin with a fixed 9-octet header followed by a variable- length payload.

+-----------------------------------------------+
|                 Length (24)                   |
+---------------+---------------+---------------+
|   Type (8)    |   Flags (8)   |
+-+-------------+---------------+-------------------------------+
|R|                 Stream Identifier (31)                      |
+=+=============================================================+
|                   Frame Payload (0...)                      ...
+---------------------------------------------------------------+

Link to this section Summary

Functions

Add padding to a frames data

Remove the padding from the payload of a frame

Transform HTTP2 frame to binary that can be transmitted over connection

Link to this section Types

Specs

flags() :: <<_::8>>

Specs

stream_id() :: 1..31

Specs

t() ::
  Ace.HTTP2.Frame.Data.t()
  | Ace.HTTP2.Frame.Headers.t()
  | Ace.HTTP2.Frame.Priority.t()
  | Ace.HTTP2.Frame.RstStream.t()
  | Ace.HTTP2.Frame.Settings.t()
  | Ace.HTTP2.Frame.PushPromise.t()
  | Ace.HTTP2.Frame.Ping.t()
  | Ace.HTTP2.Frame.GoAway.t()
  | Ace.HTTP2.Frame.WindowUpdate.t()
  | Ace.HTTP2.Frame.Continuation.t()
  | {:unknown_frame_type, integer()}

Link to this section Functions

Link to this function

pad_data(data, optional_pad_length)

View Source

Add padding to a frames data

Specs

parse(binary(), [{:max_length, binary()}]) ::
  {:ok, {t() | nil, binary()}}
  | {:error,
     :bad_settings_frame
     | {:flow_control_error, <<_::184>>}
     | {:frame_size_error, <<_::64, _::_*8>>}
     | {:protocol_error, <<_::64, _::_*8>>}}

Remove the padding from the payload of a frame

Transform HTTP2 frame to binary that can be transmitted over connection