#include <src/microserve/detail.cppm>
template<typename Derived, typename Stream>
H2SessionBase class
Constructors, destructors, conversion operators
-
H2SessionBase(Stream stream,
Handler& h,
Config::
TimeoutConfig& t, const int verbosity, const unsigned short alt_svc_port = 0) - ~H2SessionBase()
Public functions
- void start()
- void start_with_initial(const uint8_t* data, const std::size_t n)
- Start after a cleartext probe already read the connection preface (and possibly more).
- void stop()
Protected static functions
- static auto on_begin_headers(nghttp2_session*, const nghttp2_frame* frame, void* user) -> int
- static auto on_header(nghttp2_session*, const nghttp2_frame* frame, const uint8_t* name, const size_t name_len, const uint8_t* value, const size_t value_len, uint8_t, void* user) -> int
- static auto on_frame_recv(nghttp2_session*, const nghttp2_frame* frame, void* user) -> int
- static auto on_data_chunk(nghttp2_session*, uint8_t, const int32_t stream_id, const uint8_t* data, const size_t len, void* user) -> int
- static auto on_stream_close(nghttp2_session*, const int32_t stream_id, uint32_t, void* user) -> int
- static auto data_source_read(nghttp2_session*, int32_t, uint8_t* buf, const size_t length, uint32_t* data_flags, nghttp2_data_source* source, void*) -> ssize_t
Protected functions
- void on_request(const int32_t stream_id)
- void do_read()
- void do_write()
Protected variables
- Stream stream_
- nghttp2_session* session_
- Handler& handler_
-
Config::
TimeoutConfig& timeout_ -
steady_
timer timer_ - std::array<uint8_t, 64*1024> read_buf_
- std::map<int32_t, H2StreamState> streams_
- std::map<int32_t, std::unique_ptr<H2BodyHolder>> bodies_
- bool preface_logged_
- int verbosity_
- unsigned short alt_svc_port_
- bool writing_
- std::vector<uint8_t> write_buf_
- std::vector<uint8_t> writing_buf_
Function documentation
template<typename Derived, typename Stream>
void microserve:: detail:: H2SessionBase<Derived, Stream>:: start_with_initial(const uint8_t* data,
const std::size_t n)
Start after a cleartext probe already read the connection preface (and possibly more).
SETTINGS are submitted, initial bytes are ingested via mem_recv, then normal read/write loops run.