Sese Framework
2.3.0
A cross-platform framework
|
HPACK decompression tool class. More...
#include <HPackUtil.h>
Public Types | |
using | InputStream = io::InputStream |
using | OutputStream = io::OutputStream |
Public Member Functions | |
HPackUtil ()=delete | |
Public Member Functions inherited from sese::NotInstantiable | |
NotInstantiable ()=delete | |
virtual | ~NotInstantiable ()=default |
NotInstantiable (const NotInstantiable &)=delete | |
NotInstantiable & | operator= (const NotInstantiable &)=delete |
Static Public Member Functions | |
static uint32_t | decode (InputStream *src, size_t content_length, DynamicTable &table, Header &header, bool is_resp, bool has_pseudo=true, uint32_t limit=8192) noexcept |
static size_t | encode (OutputStream *dest, DynamicTable &table, Header &once_header, Header &indexed_header) noexcept |
Static Private Member Functions | |
static int | decodeInteger (uint8_t &buf, InputStream *src, uint32_t &dest, uint8_t n) noexcept |
static int | decodeString (InputStream *src, std::string &dest) noexcept |
static size_t | encodeIndexCase0 (OutputStream *dest, size_t index) noexcept |
static size_t | encodeIndexCase1 (OutputStream *dest, size_t index) noexcept |
static size_t | encodeIndexCase2 (OutputStream *dest, size_t index) noexcept |
static size_t | encodeIndexCase3 (OutputStream *dest, size_t index) noexcept |
static size_t | encodeString (OutputStream *dest, const std::string &str) noexcept |
static std::string | buildCookieString (const Cookie::Ptr &cookie) noexcept |
static bool | setHeader (Header &header, const std::string &key, const std::string &value) noexcept |
static bool | verifyHeader (Header &header, bool is_resp) noexcept |
Static Private Attributes | |
static const std::string | REQ_PSEUDO_HEADER [4] {":method", ":scheme", ":authority", ":path"} |
static HuffmanDecoder | decoder {} |
static HuffmanEncoder | encoder {} |
HPACK decompression tool class.
|
delete |
|
staticprivatenoexcept |
|
staticnoexcept |
Attempt to parse HPACK compressed HEADERS from the stream
src | Stream source |
content_length | Length of content to be parsed |
table | Dynamic table used for parsing |
header | Storage for parsing results |
is_resp | Indicates if this is a response |
has_pseudo | Need to verify pseudo-fields at the beginning |
limit | Dynamic table size limit |
Corresponds to case 0
Corresponding to case 1
Corresponding to the 2nd and 3rd cases
References sese::net::http::GOAWAY_COMPRESSION_ERROR, sese::net::http::GOAWAY_PROTOCOL_ERROR, sese::net::http::HttpUtil::parseFromCookie(), and sese::strcmpDoNotCase().
|
staticprivatenoexcept |
|
staticprivatenoexcept |
|
staticnoexcept |
Attempt to compress HEADERS in HPACK format
dest | Destination stream |
table | Dynamic table used for compression |
once_header | Non-indexed fields |
indexed_header | Indexed fields |
Corresponds to case 0
Corresponding to case 1
Add a dynamic table
Corresponds to case 0
Corresponding to case 1
Add a dynamic table
Add a dynamic table
Case 0
Case 2
Case 0
Case 2
Cookies are not compressed here
References sese::net::http::PREDEFINED_HEADERS.
|
staticprivatenoexcept |
|
staticprivatenoexcept |
|
staticprivatenoexcept |
|
staticprivatenoexcept |
|
staticprivatenoexcept |
Huffman compression is required
Huffman compression is not required
|
staticprivatenoexcept |
Check for duplicate pseudo-fields and set header values
header | Target header |
key | Key |
value | Value |
|
staticprivatenoexcept |
Validate pseudo-fields
header | Header |
is_resp | Whether it is a response |
|
staticprivate |
|
staticprivate |
|
staticprivate |