1111#include < functional>
1212#include < network/protocol/http/client/base.hpp>
1313#include < network/protocol/http/client/options.hpp>
14- #include < asio/io_service.hpp>
15- #include < asio/strand.hpp>
14+ #include < boost/ asio/io_service.hpp>
15+ #include < boost/ asio/strand.hpp>
1616#include < network/protocol/http/client/connection_manager.hpp>
1717#include < network/protocol/http/client/simple_connection_manager.hpp>
1818#include < network/protocol/http/request.hpp>
@@ -22,7 +22,7 @@ namespace network { namespace http {
2222
2323struct client_base_pimpl {
2424typedef
25- std::function<void (boost::iterator_range<char const *>const &,asio ::error_codeconst &)>
25+ std::function<void (boost::iterator_range<char const *>const &,boost::system ::error_codeconst &)>
2626 body_callback_function_type;
2727client_base_pimpl (client_optionsconst &options);
2828 responseconst request_skeleton (requestconst & request_,
@@ -34,20 +34,20 @@ struct client_base_pimpl {
3434~client_base_pimpl ();
3535private:
3636 client_options options_;
37- asio::io_service * service_ptr;
38- boost ::shared_ptr<asio::io_service::work> sentinel_;
39- boost ::shared_ptr<std::thread> lifetime_thread_;
40- boost ::shared_ptr<connection_manager> connection_manager_;
37+ boost:: asio::io_service * service_ptr;
38+ std ::shared_ptr<boost:: asio::io_service::work> sentinel_;
39+ std ::shared_ptr<std::thread> lifetime_thread_;
40+ std ::shared_ptr<connection_manager> connection_manager_;
4141bool owned_service_;
4242};
4343
4444client_base::client_base ()
45- : pimpl(new (std::nothrow) client_base_pimpl(client_options())) {
45+ : pimpl(new client_base_pimpl(client_options())) {
4646NETWORK_MESSAGE (" client_base::client_base()" );
4747}
4848
4949client_base::client_base (client_optionsconst &options)
50- : pimpl(new (std::nothrow) client_base_pimpl(options)) {
50+ : pimpl(new client_base_pimpl(options)) {
5151NETWORK_MESSAGE (" client_base::client_base(client_options const &)" );
5252}
5353
@@ -78,17 +78,17 @@ client_base_pimpl::client_base_pimpl(client_options const &options)
7878NETWORK_MESSAGE (" client_base_pimpl::client_base_pimpl(client_options const &)" );
7979if (service_ptr ==0 ) {
8080NETWORK_MESSAGE (" creating owned io_service." );
81- service_ptr =new (std::nothrow) asio::io_service;
81+ service_ptr =new boost:: asio::io_service;
8282 owned_service_ =true ;
8383 }
8484if (!connection_manager_.get ()) {
8585NETWORK_MESSAGE (" creating owned simple_connection_manager" );
8686 connection_manager_.reset (
87- new (std::nothrow) simple_connection_manager (options));
87+ new simple_connection_manager (options));
8888 }
89- sentinel_.reset (new (std::nothrow) asio::io_service::work (*service_ptr));
89+ sentinel_.reset (new boost:: asio::io_service::work (*service_ptr));
9090auto local_ptr = service_ptr;
91- lifetime_thread_.reset (new (std::nothrow) std::thread ([local_ptr]() { local_ptr->run (); }));
91+ lifetime_thread_.reset (new std::thread ([local_ptr]() { local_ptr->run (); }));
9292if (!lifetime_thread_.get ())
9393BOOST_THROW_EXCEPTION (std::runtime_error (" Cannot allocate client lifetime thread; not enough memory." ));
9494}
@@ -114,7 +114,7 @@ response const client_base_pimpl::request_skeleton(
114114 )
115115{
116116NETWORK_MESSAGE (" client_base_pimpl::request_skeleton(...)" );
117- boost ::shared_ptr<client_connection> connection_;
117+ std ::shared_ptr<client_connection> connection_;
118118 connection_ = connection_manager_->get_connection (*service_ptr, request_, options_);
119119return connection_->send_request (method, request_, get_body, callback, options);
120120}