Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
kcenon::network::protocols::http2::http_header Struct Reference

HTTP header name-value pair. More...

#include <hpack.h>

Collaboration diagram for kcenon::network::protocols::http2::http_header:
Collaboration graph

Public Member Functions

 http_header ()=default
 
 http_header (std::string n, std::string v)
 
auto size () const -> size_t
 
bool operator== (const http_header &other) const
 

Public Attributes

std::string name
 Header name.
 
std::string value
 Header value.
 

Detailed Description

HTTP header name-value pair.

Definition at line 23 of file hpack.h.

Constructor & Destructor Documentation

◆ http_header() [1/2]

kcenon::network::protocols::http2::http_header::http_header ( )
default

◆ http_header() [2/2]

kcenon::network::protocols::http2::http_header::http_header ( std::string n,
std::string v )
inline

Definition at line 29 of file hpack.h.

30 : name(std::move(n)), value(std::move(v)) {}

Member Function Documentation

◆ operator==()

bool kcenon::network::protocols::http2::http_header::operator== ( const http_header & other) const
inline

Definition at line 37 of file hpack.h.

38 {
39 return name == other.name && value == other.value;
40 }

References name, and value.

◆ size()

auto kcenon::network::protocols::http2::http_header::size ( ) const -> size_t
inline

Definition at line 32 of file hpack.h.

33 {
34 return name.size() + value.size() + 32; // RFC 7541: 32 byte overhead
35 }

References name, and value.

Referenced by kcenon::network::protocols::http2::dynamic_table::insert().

Here is the caller graph for this function:

Member Data Documentation

◆ name

std::string kcenon::network::protocols::http2::http_header::name

Header name.

Definition at line 25 of file hpack.h.

Referenced by operator==(), and size().

◆ value

std::string kcenon::network::protocols::http2::http_header::value

Header value.

Definition at line 26 of file hpack.h.

Referenced by operator==(), and size().


The documentation for this struct was generated from the following file: