diff --git a/src/App.h b/src/App.h index e55ba53..048935a 100644 --- a/src/App.h +++ b/src/App.h @@ -38,6 +38,11 @@ private: public: + /* Returns the SSL_CTX of this app, or nullptr. */ + void *getNativeHandle() { + return us_socket_context_get_native_handle(SSL, (struct us_socket_context_t *) httpContext); + } + /* Attaches a "filter" function to track socket connections/disconnections */ void filter(fu2::unique_function *, int)> &&filterHandler) { httpContext->filter(std::move(filterHandler)); diff --git a/src/AsyncSocket.h b/src/AsyncSocket.h index 9ac49c0..44bed21 100644 --- a/src/AsyncSocket.h +++ b/src/AsyncSocket.h @@ -35,6 +35,11 @@ struct AsyncSocket { friend struct TopicTree; protected: + /* Returns SSL pointer or FD as pointer */ + void *getNativeHandle() { + return us_socket_get_native_handle(SSL, (us_socket_t *) this); + } + /* Get loop data for socket */ LoopData *getLoopData() { return (LoopData *) us_loop_ext(us_socket_context_loop(SSL, us_socket_context(SSL, (us_socket_t *) this))); diff --git a/uSockets b/uSockets index fa16479..b941014 160000 --- a/uSockets +++ b/uSockets @@ -1 +1 @@ -Subproject commit fa16479609d7f5c9575499b059657819c5ab92fd +Subproject commit b941014076367bd00b4d7298e597cbfec7cb86eb