File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,16 @@ unsigned short http_request::get_requestor_port() const
295295 return http::get_port (conninfo->client_addr );
296296}
297297
298+ connection_info *http_request::get_connection_info () const
299+ {
300+ const MHD_ConnectionInfo *conninfo = MHD_get_connection_info (
301+ underlying_connection,
302+ MHD_CONNECTION_INFO_SOCKET_CONTEXT
303+ );
304+
305+ return static_cast <connection_info*>(conninfo->socket_context );
306+ }
307+
298308std::ostream &operator << (std::ostream &os, const http_request &r)
299309{
300310 os << r.get_method () << " Request [user:\" " << r.get_user () << " \" pass:\" " << r.get_pass () << " \" ] path:\" "
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ namespace httpserver
3737{
3838
3939class webserver ;
40+ class connection_info ;
4041
4142namespace http
4243{
@@ -209,6 +210,18 @@ class http_request
209210 int nonce_timeout, bool & reload_nonce
210211 ) const ;
211212
213+
214+ /* *
215+ * Returns the underlying MHD connection.
216+ * @return pointer to connection instance
217+ */
218+ MHD_Connection *get_underlying_connection () const
219+ {
220+ return underlying_connection;
221+ }
222+
223+ connection_info *get_connection_info () const ;
224+
212225 friend std::ostream &operator << (std::ostream &os, http_request &r);
213226
214227 private:
You can’t perform that action at this time.
0 commit comments