Skip to content

Commit 8a0381e

Browse files
committed
Replaced boost asio with standalone (and header only) asio (v 1.11.0).
1 parent 853550b commit 8a0381e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+407
-402
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
[submodule "deps/cxxopts"]
1111
path = deps/cxxopts
1212
url = https://github.com/jarro2783/cxxopts.git
13+
[submodule "deps/asio"]
14+
path = deps/asio
15+
url = https://github.com/chriskohlhoff/asio.git

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ if (Boost_FOUND)
9191
add_definitions(-D_WIN32_WINNT=0x0501)
9292
endif(WIN32)
9393
include_directories(${Boost_INCLUDE_DIRS})
94+
95+
# Asio
96+
add_definitions(-DASIO_HEADER_ONLY)
97+
include_directories(deps/asio/asio/include)
98+
9499
enable_testing()
95100
add_subdirectory(libs/network/src)
96101
if (CPP-NETLIB_BUILD_TESTS)

boost/network/protocol/http/client.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <boost/network/protocol/http/response.hpp>
1313
#include <boost/network/traits/ostringstream.hpp>
1414

15-
#include <boost/asio/io_service.hpp>
1615
#include <boost/algorithm/string/classification.hpp>
1716
#include <boost/algorithm/string/split.hpp>
1817
#include <istream>

boost/network/protocol/http/client/async_impl.hpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#include <thread>
1212
#include <memory>
1313
#include <functional>
14-
#include <boost/asio/io_service.hpp>
15-
#include <boost/asio/strand.hpp>
14+
#include <asio/io_service.hpp>
15+
#include <asio/strand.hpp>
1616
#include <boost/network/protocol/http/traits/connection_policy.hpp>
1717

1818
namespace boost {
@@ -32,13 +32,13 @@ struct async_client
3232
typedef typename string<Tag>::type string_type;
3333

3434
typedef std::function<void(boost::iterator_range<char const*> const&,
35-
system::error_code const&)> body_callback_function_type;
35+
std::error_code const&)> body_callback_function_type;
3636

3737
typedef std::function<bool(string_type&)> body_generator_function_type;
3838

3939
async_client(bool cache_resolved, bool follow_redirect,
4040
bool always_verify_peer, int timeout,
41-
std::shared_ptr<boost::asio::io_service> service,
41+
std::shared_ptr<asio::io_service> service,
4242
optional<string_type> certificate_filename,
4343
optional<string_type> verify_path,
4444
optional<string_type> certificate_file,
@@ -47,10 +47,10 @@ struct async_client
4747
: connection_base(cache_resolved, follow_redirect, timeout),
4848
service_ptr(service.get()
4949
? service
50-
: std::make_shared<boost::asio::io_service>()),
50+
: std::make_shared<asio::io_service>()),
5151
service_(*service_ptr),
5252
resolver_(service_),
53-
sentinel_(new boost::asio::io_service::work(service_)),
53+
sentinel_(new asio::io_service::work(service_)),
5454
certificate_filename_(std::move(certificate_filename)),
5555
verify_path_(std::move(verify_path)),
5656
certificate_file_(std::move(certificate_file)),
@@ -59,7 +59,7 @@ struct async_client
5959
ssl_options_(ssl_options),
6060
always_verify_peer_(always_verify_peer) {
6161
connection_base::resolver_strand_.reset(
62-
new boost::asio::io_service::strand(service_));
62+
new asio::io_service::strand(service_));
6363
if (!service)
6464
lifetime_thread_.reset(new std::thread([this] () { service_.run(); }));
6565
}
@@ -87,10 +87,10 @@ struct async_client
8787
generator);
8888
}
8989

90-
std::shared_ptr<boost::asio::io_service> service_ptr;
91-
boost::asio::io_service& service_;
90+
std::shared_ptr<asio::io_service> service_ptr;
91+
asio::io_service& service_;
9292
resolver_type resolver_;
93-
std::shared_ptr<boost::asio::io_service::work> sentinel_;
93+
std::shared_ptr<asio::io_service::work> sentinel_;
9494
std::shared_ptr<std::thread> lifetime_thread_;
9595
optional<string_type> certificate_filename_;
9696
optional<string_type> verify_path_;

boost/network/protocol/http/client/connection/async_base.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct async_connection_base {
3030
typedef basic_request<Tag> request;
3131
typedef basic_response<Tag> response;
3232
typedef iterator_range<char const *> char_const_range;
33-
typedef std::function<void(char_const_range const &, system::error_code const &)>
33+
typedef std::function<void(char_const_range const &, std::error_code const &)>
3434
body_callback_function_type;
3535
typedef std::function<bool(string_type &)> body_generator_function_type;
3636
typedef std::shared_ptr<this_type> connection_ptr;

0 commit comments

Comments
 (0)