#include <Http2Session.hpp>
|
| | Http2Session (std::weak_ptr< server::Connection > connection, network::Proactor &proactor, const routing::Router &router, concurrency::ThreadPool &thread_pool, std::string client_ip, size_t max_body_size) |
| |
| | ~Http2Session () |
| |
| void | process_data (const uint8_t *data, size_t len) |
| |
| void | send_pending () |
| |
| void | begin_shutdown () |
| | Sends GOAWAY: the client opens no new streams; open ones may finish.
|
| |
| bool | idle () |
| | True if no stream is open.
|
| |
| void | close_streams () |
| | The connection is gone: every open stream's writer reports closed.
|
| |
| void | submit_response (int32_t stream_id, http::HttpResponse &response, bool has_body, bool streaming=false) |
| | Thread-safe API to submit an HTTP/2 response.
|
| |
| void | submit_data (int32_t stream_id, std::string_view chunk) |
| | Appends chunk to a streaming response (see Http2ResponseWriter::send_headers).
|
| |
| void | end_stream (int32_t stream_id) |
| | Ends a streaming response.
|
| |
| network::Proactor & | proactor () |
| |
| concurrency::ThreadPool & | thread_pool () |
| |
|
| static int | on_begin_headers (nghttp2_session *session, const nghttp2_frame *frame, void *user_data) |
| |
| static int | on_header (nghttp2_session *session, const nghttp2_frame *frame, const uint8_t *name, size_t namelen, const uint8_t *value, size_t valuelen, uint8_t flags, void *user_data) |
| |
| static int | on_frame_recv (nghttp2_session *session, const nghttp2_frame *frame, void *user_data) |
| |
| static int | on_data_chunk_recv (nghttp2_session *session, uint8_t flags, int32_t stream_id, const uint8_t *data, size_t len, void *user_data) |
| |
| static int | on_stream_close (nghttp2_session *session, int32_t stream_id, uint32_t error_code, void *user_data) |
| |
| static ssize_t | send_callback (nghttp2_session *session, const uint8_t *data, size_t length, int flags, void *user_data) |
| |
| static ssize_t | data_provider_read (nghttp2_session *session, int32_t stream_id, uint8_t *buf, size_t length, uint32_t *data_flags, nghttp2_data_source *source, void *user_data) |
| |
◆ Http2Session()
◆ ~Http2Session()
| orbit::http::h2::Http2Session::~Http2Session |
( |
| ) |
|
◆ begin_shutdown()
| void orbit::http::h2::Http2Session::begin_shutdown |
( |
| ) |
|
Sends GOAWAY: the client opens no new streams; open ones may finish.
◆ close_streams()
| void orbit::http::h2::Http2Session::close_streams |
( |
| ) |
|
The connection is gone: every open stream's writer reports closed.
◆ data_provider_read()
| static ssize_t orbit::http::h2::Http2Session::data_provider_read |
( |
nghttp2_session * |
session, |
|
|
int32_t |
stream_id, |
|
|
uint8_t * |
buf, |
|
|
size_t |
length, |
|
|
uint32_t * |
data_flags, |
|
|
nghttp2_data_source * |
source, |
|
|
void * |
user_data |
|
) |
| |
|
staticprivate |
◆ dispatch_request()
| void orbit::http::h2::Http2Session::dispatch_request |
( |
std::shared_ptr< StreamContext > |
stream_ctx | ) |
|
|
private |
◆ end_stream()
| void orbit::http::h2::Http2Session::end_stream |
( |
int32_t |
stream_id | ) |
|
Ends a streaming response.
◆ idle()
| bool orbit::http::h2::Http2Session::idle |
( |
| ) |
|
True if no stream is open.
◆ on_begin_headers()
| static int orbit::http::h2::Http2Session::on_begin_headers |
( |
nghttp2_session * |
session, |
|
|
const nghttp2_frame * |
frame, |
|
|
void * |
user_data |
|
) |
| |
|
staticprivate |
◆ on_data_chunk_recv()
| static int orbit::http::h2::Http2Session::on_data_chunk_recv |
( |
nghttp2_session * |
session, |
|
|
uint8_t |
flags, |
|
|
int32_t |
stream_id, |
|
|
const uint8_t * |
data, |
|
|
size_t |
len, |
|
|
void * |
user_data |
|
) |
| |
|
staticprivate |
◆ on_frame_recv()
| static int orbit::http::h2::Http2Session::on_frame_recv |
( |
nghttp2_session * |
session, |
|
|
const nghttp2_frame * |
frame, |
|
|
void * |
user_data |
|
) |
| |
|
staticprivate |
◆ on_header()
| static int orbit::http::h2::Http2Session::on_header |
( |
nghttp2_session * |
session, |
|
|
const nghttp2_frame * |
frame, |
|
|
const uint8_t * |
name, |
|
|
size_t |
namelen, |
|
|
const uint8_t * |
value, |
|
|
size_t |
valuelen, |
|
|
uint8_t |
flags, |
|
|
void * |
user_data |
|
) |
| |
|
staticprivate |
◆ on_stream_close()
| static int orbit::http::h2::Http2Session::on_stream_close |
( |
nghttp2_session * |
session, |
|
|
int32_t |
stream_id, |
|
|
uint32_t |
error_code, |
|
|
void * |
user_data |
|
) |
| |
|
staticprivate |
◆ proactor()
◆ process_data()
| void orbit::http::h2::Http2Session::process_data |
( |
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
◆ send_callback()
| static ssize_t orbit::http::h2::Http2Session::send_callback |
( |
nghttp2_session * |
session, |
|
|
const uint8_t * |
data, |
|
|
size_t |
length, |
|
|
int |
flags, |
|
|
void * |
user_data |
|
) |
| |
|
staticprivate |
◆ send_pending()
| void orbit::http::h2::Http2Session::send_pending |
( |
| ) |
|
◆ submit_data()
| void orbit::http::h2::Http2Session::submit_data |
( |
int32_t |
stream_id, |
|
|
std::string_view |
chunk |
|
) |
| |
◆ submit_response()
| void orbit::http::h2::Http2Session::submit_response |
( |
int32_t |
stream_id, |
|
|
http::HttpResponse & |
response, |
|
|
bool |
has_body, |
|
|
bool |
streaming = false |
|
) |
| |
Thread-safe API to submit an HTTP/2 response.
- Parameters
-
| stream_id | The HTTP/2 stream identifier. |
| response | The HttpResponse to send. |
| has_body | True if the response includes a body. Takes ownership of response.file_fd when a file body is sent. |
◆ submit_status_locked()
| void orbit::http::h2::Http2Session::submit_status_locked |
( |
int32_t |
stream_id, |
|
|
http::HttpStatus |
status |
|
) |
| |
|
private |
◆ thread_pool()
◆ client_ip_
| std::string orbit::http::h2::Http2Session::client_ip_ |
|
private |
◆ connection_
◆ max_body_size_
| size_t orbit::http::h2::Http2Session::max_body_size_ |
|
private |
◆ proactor_
◆ router_
◆ session_
| nghttp2_session* orbit::http::h2::Http2Session::session_ {nullptr} |
|
private |
◆ session_mutex_
| std::mutex orbit::http::h2::Http2Session::session_mutex_ |
|
private |
◆ streams_
| std::unordered_map<int32_t, std::shared_ptr<StreamContext> > orbit::http::h2::Http2Session::streams_ |
|
private |
◆ thread_pool_
The documentation for this class was generated from the following file: