libnghttp2_asio: Optimized remote endpoint interface to const ref where possible
This commit is contained in:
parent
a30dad4f5e
commit
9f2d064d7c
|
@ -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:
|
||||||
|
|
||||||
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 {
|
||||||
|
|
||||||
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) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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:
|
||||||
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:
|
||||||
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_;
|
||||||
|
|
Loading…
Reference in New Issue