Commit 9f2d064d authored by Andreas Pohl's avatar Andreas Pohl

libnghttp2_asio: Optimized remote endpoint interface to const ref where possible

parent a30dad4f
...@@ -453,7 +453,9 @@ response *http2_handler::push_promise(boost::system::error_code &ec, ...@@ -453,7 +453,9 @@ response *http2_handler::push_promise(boost::system::error_code &ec,
boost::asio::io_service &http2_handler::io_service() { return io_service_; } boost::asio::io_service &http2_handler::io_service() { return io_service_; }
boost::asio::ip::tcp::endpoint http2_handler::remote_endpoint() { return remote_ep_; } const boost::asio::ip::tcp::endpoint &http2_handler::remote_endpoint() {
return remote_ep_;
}
callback_guard::callback_guard(http2_handler &h) : handler(h) { callback_guard::callback_guard(http2_handler &h) : handler(h) {
handler.enter_callback(); handler.enter_callback();
......
...@@ -90,7 +90,7 @@ public: ...@@ -90,7 +90,7 @@ public:
boost::asio::io_service &io_service(); boost::asio::io_service &io_service();
boost::asio::ip::tcp::endpoint remote_endpoint(); const boost::asio::ip::tcp::endpoint &remote_endpoint();
const std::string &http_date(); const std::string &http_date();
......
...@@ -50,7 +50,7 @@ void request::on_data(data_cb cb) const { ...@@ -50,7 +50,7 @@ void request::on_data(data_cb cb) const {
request_impl &request::impl() const { return *impl_; } request_impl &request::impl() const { return *impl_; }
boost::asio::ip::tcp::endpoint request::remote_endpoint() const { const boost::asio::ip::tcp::endpoint &request::remote_endpoint() const {
return impl_->remote_endpoint(); return impl_->remote_endpoint();
} }
......
...@@ -54,7 +54,7 @@ void request_impl::call_on_data(const uint8_t *data, std::size_t len) { ...@@ -54,7 +54,7 @@ void request_impl::call_on_data(const uint8_t *data, std::size_t len) {
} }
} }
boost::asio::ip::tcp::endpoint request_impl::remote_endpoint() const { const boost::asio::ip::tcp::endpoint &request_impl::remote_endpoint() const {
return remote_ep_; return remote_ep_;
} }
......
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
void stream(class stream *s); void stream(class stream *s);
void call_on_data(const uint8_t *data, std::size_t len); void call_on_data(const uint8_t *data, std::size_t len);
boost::asio::ip::tcp::endpoint remote_endpoint() const; const boost::asio::ip::tcp::endpoint &remote_endpoint() const;
void remote_endpoint(boost::asio::ip::tcp::endpoint ep); void remote_endpoint(boost::asio::ip::tcp::endpoint ep);
private: private:
......
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
request_impl &impl() const; request_impl &impl() const;
// Returns the remote endpoint of the request // Returns the remote endpoint of the request
boost::asio::ip::tcp::endpoint remote_endpoint() const; const boost::asio::ip::tcp::endpoint &remote_endpoint() const;
private: private:
std::unique_ptr<request_impl> impl_; std::unique_ptr<request_impl> impl_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment