|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
HPACK dynamic table for header compression. More...
#include <hpack.h>

Public Member Functions | |
| dynamic_table (size_t max_size=4096) | |
| Construct dynamic table with max size. | |
| auto | insert (std::string_view name, std::string_view value) -> void |
| Insert header at beginning of table. | |
| auto | get (size_t index) const -> std::optional< http_header > |
| Get header by dynamic table index. | |
| auto | find (std::string_view name, std::string_view value="") const -> std::optional< size_t > |
| Find header in dynamic table. | |
| auto | set_max_size (size_t size) -> void |
| Set maximum table size. | |
| auto | current_size () const -> size_t |
| Get current table size. | |
| auto | max_size () const -> size_t |
| Get maximum table size. | |
| auto | entry_count () const -> size_t |
| Get number of entries. | |
| auto | clear () -> void |
| Clear all entries. | |
Private Member Functions | |
| auto | evict_to_size (size_t target_size) -> void |
Private Attributes | |
| std::deque< http_header > | entries_ |
| size_t | current_size_ = 0 |
| size_t | max_size_ |
HPACK dynamic table for header compression.
The dynamic table maintains recently used headers for compression. Entries are added at the beginning and evicted from the end when the table exceeds max_size.
|
explicit |
Construct dynamic table with max size.
| max_size | Maximum table size in bytes (default 4096) |
| auto kcenon::network::protocols::http2::dynamic_table::clear | ( | ) | -> void |
Clear all entries.
Definition at line 175 of file hpack.cpp.
| auto kcenon::network::protocols::http2::dynamic_table::current_size | ( | ) | const -> size_t |
Get current table size.
Definition at line 160 of file hpack.cpp.
References current_size_.
Referenced by kcenon::network::protocols::http2::hpack_decoder::table_size(), and kcenon::network::protocols::http2::hpack_encoder::table_size().

| auto kcenon::network::protocols::http2::dynamic_table::entry_count | ( | ) | const -> size_t |
|
private |
| auto kcenon::network::protocols::http2::dynamic_table::find | ( | std::string_view | name, |
| std::string_view | value = "" ) const -> std::optional<size_t> |
Find header in dynamic table.
| name | Header name |
| value | Header value (empty to match name only) |
| auto kcenon::network::protocols::http2::dynamic_table::get | ( | size_t | index | ) | const -> std::optional<http_header> |
| auto kcenon::network::protocols::http2::dynamic_table::insert | ( | std::string_view | name, |
| std::string_view | value ) -> void |
Insert header at beginning of table.
| name | Header name |
| value | Header value |
Definition at line 115 of file hpack.cpp.
References kcenon::network::protocols::http2::http_header::size().

| auto kcenon::network::protocols::http2::dynamic_table::max_size | ( | ) | const -> size_t |
| auto kcenon::network::protocols::http2::dynamic_table::set_max_size | ( | size_t | size | ) | -> void |
Set maximum table size.
| size | New maximum size in bytes |
|
private |
Definition at line 148 of file hpack.h.
Referenced by current_size().
|
private |
Definition at line 147 of file hpack.h.
Referenced by entry_count().
|
private |
Definition at line 149 of file hpack.h.
Referenced by max_size().