From 3e5607fd3d7404e9e3062c08c7be673f0a6ae4bf Mon Sep 17 00:00:00 2001 From: Povilas Balciunas Date: Fri, 7 Nov 2014 18:49:22 +0200 Subject: [PATCH 1/4] Supressed unused variable warning. --- .../protocol/http/client/connection/normal_delegate.ipp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boost/network/protocol/http/client/connection/normal_delegate.ipp b/boost/network/protocol/http/client/connection/normal_delegate.ipp index a34e8edc2..a86ac94e6 100644 --- a/boost/network/protocol/http/client/connection/normal_delegate.ipp +++ b/boost/network/protocol/http/client/connection/normal_delegate.ipp @@ -21,6 +21,9 @@ boost::network::http::impl::normal_delegate::normal_delegate( void boost::network::http::impl::normal_delegate::connect( asio::ip::tcp::endpoint &endpoint, std::string host, function handler) { + + (void)host; + socket_.reset(new asio::ip::tcp::socket(service_)); socket_->async_connect(endpoint, handler); } From f1f4a43668ee51f4829f5eb169dbf99125d31537 Mon Sep 17 00:00:00 2001 From: Povilas Balciunas Date: Fri, 7 Nov 2014 19:18:51 +0200 Subject: [PATCH 2/4] Refactored code. --- .../http/client/connection/async_protocol_handler.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/boost/network/protocol/http/client/connection/async_protocol_handler.hpp b/boost/network/protocol/http/client/connection/async_protocol_handler.hpp index b6c419bbb..0f5da644d 100644 --- a/boost/network/protocol/http/client/connection/async_protocol_handler.hpp +++ b/boost/network/protocol/http/client/connection/async_protocol_handler.hpp @@ -49,20 +49,26 @@ struct http_async_protocol_handler { boost::shared_future source_future( source_promise.get_future()); source(response_, source_future); + boost::shared_future destination_future( destination_promise.get_future()); destination(response_, destination_future); + boost::shared_future::type> headers_future( headers_promise.get_future()); headers(response_, headers_future); + boost::shared_future body_future(body_promise.get_future()); body(response_, body_future); + boost::shared_future version_future( version_promise.get_future()); version(response_, version_future); + boost::shared_future status_future( status_promise.get_future()); status(response_, status_future); + boost::shared_future status_message_future( status_message_promise.get_future()); status_message(response_, status_message_future); From 03efd34e480ce6ea4ca04a0962ea5d0b327a9296 Mon Sep 17 00:00:00 2001 From: Povilas Balciunas Date: Fri, 7 Nov 2014 19:20:45 +0200 Subject: [PATCH 3/4] Supressed unused parameter warnings. --- .../protocol/http/client/connection/async_normal.hpp | 2 ++ .../http/client/connection/async_protocol_handler.hpp | 2 ++ .../network/protocol/http/client/connection/sync_base.hpp | 4 ++++ .../network/protocol/http/policies/pooled_connection.hpp | 8 +++++++- .../network/protocol/http/policies/simple_connection.hpp | 6 ++++++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/boost/network/protocol/http/client/connection/async_normal.hpp b/boost/network/protocol/http/client/connection/async_normal.hpp index 84f1236a9..74847edf4 100644 --- a/boost/network/protocol/http/client/connection/async_normal.hpp +++ b/boost/network/protocol/http/client/connection/async_normal.hpp @@ -199,6 +199,8 @@ struct http_async_connection body_generator_function_type generator, boost::system::error_code const& ec, std::size_t bytes_transferred) { + (void)bytes_transferred; + if (!is_timedout_ && !ec) { if (generator) { // Here we write some more data that the generator provides, diff --git a/boost/network/protocol/http/client/connection/async_protocol_handler.hpp b/boost/network/protocol/http/client/connection/async_protocol_handler.hpp index 0f5da644d..afcd38434 100644 --- a/boost/network/protocol/http/client/connection/async_protocol_handler.hpp +++ b/boost/network/protocol/http/client/connection/async_protocol_handler.hpp @@ -46,6 +46,8 @@ struct http_async_protocol_handler { template void init_response(ResponseType& response_, bool get_body) { + (void)get_body; + boost::shared_future source_future( source_promise.get_future()); source(response_, source_future); diff --git a/boost/network/protocol/http/client/connection/sync_base.hpp b/boost/network/protocol/http/client/connection/sync_base.hpp index 094afefcc..2981b19b4 100644 --- a/boost/network/protocol/http/client/connection/sync_base.hpp +++ b/boost/network/protocol/http/client/connection/sync_base.hpp @@ -102,6 +102,8 @@ struct sync_connection_base_impl { template void send_request_impl(Socket& socket_, string_type const& method, boost::asio::streambuf& request_buffer) { + (void)method; + write(socket_, request_buffer); } @@ -109,6 +111,8 @@ struct sync_connection_base_impl { void read_body_normal(Socket& socket_, basic_response& response_, boost::asio::streambuf& response_buffer, typename ostringstream::type& body_stream) { + (void)response_; + boost::system::error_code error; if (response_buffer.size() > 0) body_stream << &response_buffer; diff --git a/boost/network/protocol/http/policies/pooled_connection.hpp b/boost/network/protocol/http/policies/pooled_connection.hpp index 8a440dfe5..85b9341bb 100644 --- a/boost/network/protocol/http/policies/pooled_connection.hpp +++ b/boost/network/protocol/http/policies/pooled_connection.hpp @@ -65,7 +65,11 @@ struct pooled_connection_policy : resolver_policy::type { certificate_filename_(certificate_filename), verify_path_(verify_path), certificate_file_(certificate_file), - private_key_file_(private_key_file) {} + private_key_file_(private_key_file) { + + (void)host; + (void)port; + } basic_response send_request(string_type const& method, basic_request request_, bool get_body, @@ -79,6 +83,8 @@ struct pooled_connection_policy : resolver_policy::type { string_type const& method, basic_request request_, bool get_body, body_callback_function_type callback, body_generator_function_type generator) { + (void)callback; + boost::uint8_t count = 0; bool retry = false; do { diff --git a/boost/network/protocol/http/policies/simple_connection.hpp b/boost/network/protocol/http/policies/simple_connection.hpp index ec09f18a3..589dbb1ee 100644 --- a/boost/network/protocol/http/policies/simple_connection.hpp +++ b/boost/network/protocol/http/policies/simple_connection.hpp @@ -50,6 +50,10 @@ struct simple_connection_policy : resolver_policy::type { optional const& certificate_file = optional(), optional const& private_key_file = optional()) : pimpl(), follow_redirect_(follow_redirect) { + + (void)hostname; + (void)port; + pimpl.reset(impl::sync_connection_base< Tag, version_major, version_minor>::new_connection(resolver, resolve, https, @@ -62,6 +66,8 @@ struct simple_connection_policy : resolver_policy::type { basic_request request_, bool get_body, body_callback_function_type callback, body_generator_function_type generator) { + (void)callback; + basic_response response_; do { pimpl->init_socket(request_.host(), From 7b937731b9205f11d63248b3d8760a114837f8bd Mon Sep 17 00:00:00 2001 From: Povilas Balciunas Date: Mon, 10 Nov 2014 18:32:50 +0200 Subject: [PATCH 4/4] Added todo notes for dberris to review supressed unused parameter warnings. --- boost/network/protocol/http/client/connection/async_normal.hpp | 1 + .../protocol/http/client/connection/async_protocol_handler.hpp | 1 + .../network/protocol/http/client/connection/normal_delegate.ipp | 1 + boost/network/protocol/http/client/connection/sync_base.hpp | 2 ++ boost/network/protocol/http/policies/pooled_connection.hpp | 2 ++ boost/network/protocol/http/policies/simple_connection.hpp | 2 ++ 6 files changed, 9 insertions(+) diff --git a/boost/network/protocol/http/client/connection/async_normal.hpp b/boost/network/protocol/http/client/connection/async_normal.hpp index 74847edf4..df98bd32a 100644 --- a/boost/network/protocol/http/client/connection/async_normal.hpp +++ b/boost/network/protocol/http/client/connection/async_normal.hpp @@ -199,6 +199,7 @@ struct http_async_connection body_generator_function_type generator, boost::system::error_code const& ec, std::size_t bytes_transferred) { + // TODO(dberris): review parameter necessity. (void)bytes_transferred; if (!is_timedout_ && !ec) { diff --git a/boost/network/protocol/http/client/connection/async_protocol_handler.hpp b/boost/network/protocol/http/client/connection/async_protocol_handler.hpp index afcd38434..2c8a5b717 100644 --- a/boost/network/protocol/http/client/connection/async_protocol_handler.hpp +++ b/boost/network/protocol/http/client/connection/async_protocol_handler.hpp @@ -46,6 +46,7 @@ struct http_async_protocol_handler { template void init_response(ResponseType& response_, bool get_body) { + // TODO(dberris): review parameter necessity. (void)get_body; boost::shared_future source_future( diff --git a/boost/network/protocol/http/client/connection/normal_delegate.ipp b/boost/network/protocol/http/client/connection/normal_delegate.ipp index a86ac94e6..167601959 100644 --- a/boost/network/protocol/http/client/connection/normal_delegate.ipp +++ b/boost/network/protocol/http/client/connection/normal_delegate.ipp @@ -22,6 +22,7 @@ void boost::network::http::impl::normal_delegate::connect( asio::ip::tcp::endpoint &endpoint, std::string host, function handler) { + // TODO(dberris): review parameter necessity. (void)host; socket_.reset(new asio::ip::tcp::socket(service_)); diff --git a/boost/network/protocol/http/client/connection/sync_base.hpp b/boost/network/protocol/http/client/connection/sync_base.hpp index 2981b19b4..12ba6e2dc 100644 --- a/boost/network/protocol/http/client/connection/sync_base.hpp +++ b/boost/network/protocol/http/client/connection/sync_base.hpp @@ -102,6 +102,7 @@ struct sync_connection_base_impl { template void send_request_impl(Socket& socket_, string_type const& method, boost::asio::streambuf& request_buffer) { + // TODO(dberris): review parameter necessity. (void)method; write(socket_, request_buffer); @@ -111,6 +112,7 @@ struct sync_connection_base_impl { void read_body_normal(Socket& socket_, basic_response& response_, boost::asio::streambuf& response_buffer, typename ostringstream::type& body_stream) { + // TODO(dberris): review parameter necessity. (void)response_; boost::system::error_code error; diff --git a/boost/network/protocol/http/policies/pooled_connection.hpp b/boost/network/protocol/http/policies/pooled_connection.hpp index 85b9341bb..6d4eb81a1 100644 --- a/boost/network/protocol/http/policies/pooled_connection.hpp +++ b/boost/network/protocol/http/policies/pooled_connection.hpp @@ -67,6 +67,7 @@ struct pooled_connection_policy : resolver_policy::type { certificate_file_(certificate_file), private_key_file_(private_key_file) { + // TODO(dberris): review parameter necessity. (void)host; (void)port; } @@ -83,6 +84,7 @@ struct pooled_connection_policy : resolver_policy::type { string_type const& method, basic_request request_, bool get_body, body_callback_function_type callback, body_generator_function_type generator) { + // TODO(dberris): review parameter necessity. (void)callback; boost::uint8_t count = 0; diff --git a/boost/network/protocol/http/policies/simple_connection.hpp b/boost/network/protocol/http/policies/simple_connection.hpp index 589dbb1ee..da27aed7f 100644 --- a/boost/network/protocol/http/policies/simple_connection.hpp +++ b/boost/network/protocol/http/policies/simple_connection.hpp @@ -51,6 +51,7 @@ struct simple_connection_policy : resolver_policy::type { optional const& private_key_file = optional()) : pimpl(), follow_redirect_(follow_redirect) { + // TODO(dberris): review parameter necessity. (void)hostname; (void)port; @@ -66,6 +67,7 @@ struct simple_connection_policy : resolver_policy::type { basic_request request_, bool get_body, body_callback_function_type callback, body_generator_function_type generator) { + // TODO(dberris): review parameter necessity. (void)callback; basic_response response_;