add session timeout on proxy server

This commit is contained in:
Martin Michelsen
2022-03-29 23:22:45 -07:00
parent f3a3e18455
commit 03dcc016d8
2 changed files with 37 additions and 2 deletions
+4
View File
@@ -33,6 +33,8 @@ public:
struct LinkedSession {
ProxyServer* server;
std::unique_ptr<struct event, void(*)(struct event*)> timeout_event;
std::shared_ptr<const License> license;
std::unique_ptr<struct bufferevent, void(*)(struct bufferevent*)> client_bev;
@@ -93,9 +95,11 @@ public:
static void dispatch_on_server_input(struct bufferevent* bev, void* ctx);
static void dispatch_on_server_error(struct bufferevent* bev, short events,
void* ctx);
static void dispatch_on_timeout(evutil_socket_t fd, short what, void* ctx);
void on_client_input();
void on_server_input();
void on_stream_error(short events, bool is_server_stream);
void on_timeout();
void send_to_end(const void* data, size_t size, bool to_server);
void send_to_end(const std::string& data, bool to_server);