|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
HEADERS frame (RFC 7540 Section 6.2) More...
#include <frame.h>


Public Member Functions | |
| headers_frame (uint32_t stream_id, std::vector< uint8_t > header_block, bool end_stream=false, bool end_headers=true) | |
| Construct HEADERS frame. | |
| auto | is_end_stream () const -> bool |
| Check if END_STREAM flag is set. | |
| auto | is_end_headers () const -> bool |
| Check if END_HEADERS flag is set. | |
| auto | header_block () const -> std::span< const uint8_t > |
| Get header block fragment. | |
Public Member Functions inherited from kcenon::network::protocols::http2::frame | |
| frame ()=default | |
| Default constructor. | |
| frame (const frame_header &hdr, std::vector< uint8_t > payload) | |
| Construct frame with header and payload. | |
| auto | serialize () const -> std::vector< uint8_t > |
| Serialize frame to bytes. | |
| auto | header () const -> const frame_header & |
| Get frame header. | |
| auto | payload () const -> std::span< const uint8_t > |
| Get frame payload. | |
| virtual | ~frame ()=default |
| Virtual destructor. | |
Static Public Member Functions | |
| static auto | parse (const frame_header &hdr, std::span< const uint8_t > payload) -> Result< std::unique_ptr< headers_frame > > |
| Parse HEADERS frame from raw bytes. | |
Static Public Member Functions inherited from kcenon::network::protocols::http2::frame | |
| static auto | parse (std::span< const uint8_t > data) -> Result< std::unique_ptr< frame > > |
| Parse frame from raw bytes. | |
Private Attributes | |
| std::vector< uint8_t > | header_block_ |
| Header block fragment. | |
Additional Inherited Members | |
Protected Attributes inherited from kcenon::network::protocols::http2::frame | |
| frame_header | header_ |
| Frame header. | |
| std::vector< uint8_t > | payload_ |
| Frame payload. | |
HEADERS frame (RFC 7540 Section 6.2)
HEADERS frames are used to open a stream and carry a header block fragment.
| kcenon::network::protocols::http2::headers_frame::headers_frame | ( | uint32_t | stream_id, |
| std::vector< uint8_t > | header_block, | ||
| bool | end_stream = false, | ||
| bool | end_headers = true ) |
Construct HEADERS frame.
| stream_id | Stream identifier |
| header_block | Header block fragment |
| end_stream | True if this is the last frame in stream |
| end_headers | True if this is the last header frame |
| priority_data | Optional priority information |
Definition at line 272 of file frame.cpp.
References kcenon::network::protocols::http2::frame_flags::end_headers, kcenon::network::protocols::http2::frame_flags::end_stream, kcenon::network::protocols::http2::frame_header::flags, kcenon::network::protocols::http2::frame::header_, header_block_, kcenon::network::protocols::http2::headers, kcenon::network::protocols::http2::frame_header::length, kcenon::network::protocols::http2::frame_flags::none, kcenon::network::protocols::http2::frame::payload_, kcenon::network::protocols::http2::frame_header::stream_id, and kcenon::network::protocols::http2::frame_header::type.
| auto kcenon::network::protocols::http2::headers_frame::header_block | ( | ) | const -> std::span<const uint8_t> |
Get header block fragment.
Definition at line 348 of file frame.cpp.
References header_block_.
| auto kcenon::network::protocols::http2::headers_frame::is_end_headers | ( | ) | const -> bool |
Check if END_HEADERS flag is set.
Definition at line 343 of file frame.cpp.
References kcenon::network::protocols::http2::frame_flags::end_headers, kcenon::network::protocols::http2::frame_header::flags, and kcenon::network::protocols::http2::frame::header_.
| auto kcenon::network::protocols::http2::headers_frame::is_end_stream | ( | ) | const -> bool |
Check if END_STREAM flag is set.
Definition at line 338 of file frame.cpp.
References kcenon::network::protocols::http2::frame_flags::end_stream, kcenon::network::protocols::http2::frame_header::flags, and kcenon::network::protocols::http2::frame::header_.
|
static |
Parse HEADERS frame from raw bytes.
| hdr | Frame header (must be HEADERS type) |
| payload | Frame payload |
Definition at line 294 of file frame.cpp.
References kcenon::network::protocols::http2::frame_flags::end_headers, kcenon::network::protocols::http2::frame_flags::end_stream, and kcenon::network::protocols::http2::frame_flags::padded.
Referenced by kcenon::network::protocols::http2::frame::parse().

|
private |
Header block fragment.
Definition at line 230 of file frame.h.
Referenced by header_block(), and headers_frame().