diff --git a/src/asio_http2_handler.cc b/src/asio_http2_handler.cc index 334be504..3ab13859 100644 --- a/src/asio_http2_handler.cc +++ b/src/asio_http2_handler.cc @@ -77,6 +77,10 @@ void response::resume() const { impl_->resume(); } unsigned int response::status_code() const { return impl_->status_code(); } +boost::asio::io_service &response::io_service() const { + return impl_->io_service(); +} + bool response::started() const { return impl_->started(); } response_impl &response::impl() const { return *impl_; } @@ -184,6 +188,10 @@ void response_impl::resume() { } } +boost::asio::io_service &response_impl::io_service() { + return stream_->handler()->io_service(); +} + bool response_impl::started() const { return started_; } void response_impl::pushed(bool f) { pushed_ = f; } diff --git a/src/asio_http2_handler.h b/src/asio_http2_handler.h index 84c204ad..b5846024 100644 --- a/src/asio_http2_handler.h +++ b/src/asio_http2_handler.h @@ -84,6 +84,8 @@ public: response *push(boost::system::error_code &ec, std::string method, std::string raw_path_query, header_map h = {}) const; + boost::asio::io_service &io_service(); + void start_response(); unsigned int status_code() const; diff --git a/src/includes/nghttp2/asio_http2_server.h b/src/includes/nghttp2/asio_http2_server.h index ee7f3f55..2a2e0c49 100644 --- a/src/includes/nghttp2/asio_http2_server.h +++ b/src/includes/nghttp2/asio_http2_server.h @@ -98,6 +98,9 @@ public: // Returns true if response has been started. bool started() const; + // Returns boost::asio::io_service this response is running on. + boost::asio::io_service &io_service() const; + // Application must not call this directly. response_impl &impl() const;