Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix for boost 1.70 (get_io_service() was deprecated and was removed)#878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deanberris merged 6 commits intocpp-netlib:0.13-releasefromenricodetoma:0.13-release
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Fix for boost 1.70 (get_io_service() was deprecated and was removed)
  • Loading branch information
@enricodetoma
enricodetoma committedAug 8, 2019
commit9aaa54606b744841f878485044a8d3e0dbb24984
17 changes: 17 additions & 0 deletionsboost/network/compat.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
#ifndef BOOST_NETWORK_COMPAT_HPP__
#define BOOST_NETWORK_COMPAT_HPP__

// Copyright 2010 (C) Dean Michael Berris
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

// This macro is used to solve a compatibility problem with Boost >= 1.70
// where the deprecated method get_io_service() was removed
#if BOOST_VERSION >= 107000
#define CPP_NETLIB_ASIO_GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
#else
#define CPP_NETLIB_ASIO_GET_IO_SERVICE(s) ((s).get_io_service())
#endif

#endif // BOOST_NETWORK_COMPAT_HPP__
11 changes: 2 additions & 9 deletionsboost/network/protocol/http/client/connection/async_base.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,14 +16,7 @@
#include <boost/network/protocol/http/client/connection/async_normal.hpp>
#include <boost/network/protocol/http/traits/resolver_policy.hpp>
#include <boost/network/traits/string.hpp>

#ifndef GET_IO_SERVICE
#if BOOST_VERSION >= 107000
#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
#else
#define GET_IO_SERVICE(s) ((s).get_io_service())
#endif
#endif
#include <boost/network/compat.hpp>

namespace boost {
namespace network {
Expand DownExpand Up@@ -67,7 +60,7 @@ struct async_connection_base {
async_connection;
typedef typename delegate_factory<Tag>::type delegate_factory_type;
auto delegate = delegate_factory_type::new_connection_delegate(
GET_IO_SERVICE(resolver), https, always_verify_peer,
CPP_NETLIB_ASIO_GET_IO_SERVICE(resolver), https, always_verify_peer,
certificate_filename, verify_path, certificate_file, private_key_file,
ciphers, sni_hostname, ssl_options);
auto temp = std::make_shared<async_connection>(
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,14 +32,7 @@
#include <boost/range/algorithm/transform.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/throw_exception.hpp>

#ifndef GET_IO_SERVICE
#if BOOST_VERSION >= 107000
#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
#else
#define GET_IO_SERVICE(s) ((s).get_io_service())
#endif
#endif
#include <boost/network/compat.hpp>

namespace boost {
namespace network {
Expand DownExpand Up@@ -162,12 +155,12 @@ struct http_async_connection
connection_delegate_ptr delegate)
: timeout_(timeout),
remove_chunk_markers_(remove_chunk_markers),
timer_(GET_IO_SERVICE(resolver)),
timer_(CPP_NETLIB_ASIO_GET_IO_SERVICE(resolver)),
is_timedout_(false),
follow_redirect_(follow_redirect),
resolver_(resolver),
resolve_(std::move(resolve)),
request_strand_(GET_IO_SERVICE(resolver)),
request_strand_(CPP_NETLIB_ASIO_GET_IO_SERVICE(resolver)),
delegate_(std::move(delegate)) {}

// This is the main entry point for the connection/request pipeline.
Expand Down
13 changes: 3 additions & 10 deletionsboost/network/protocol/http/client/connection/sync_normal.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,14 +16,7 @@
#include <boost/network/protocol/http/response.hpp>
#include <boost/network/protocol/http/traits/resolver_policy.hpp>
#include <boost/network/traits/string.hpp>

#ifndef GET_IO_SERVICE
#if BOOST_VERSION >= 107000
#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
#else
#define GET_IO_SERVICE(s) ((s).get_io_service())
#endif
#endif
#include <boost/network/compat.hpp>

namespace boost {
namespace network {
Expand DownExpand Up@@ -57,10 +50,10 @@ struct http_sync_connection
int timeout)
: connection_base(),
timeout_(timeout),
timer_(GET_IO_SERVICE(resolver)),
timer_(CPP_NETLIB_ASIO_GET_IO_SERVICE(resolver)),
resolver_(resolver),
resolve_(std::move(resolve)),
socket_(GET_IO_SERVICE(resolver)) {}
socket_(CPP_NETLIB_ASIO_GET_IO_SERVICE(resolver)) {}

void init_socket(string_type const& hostname, string_type const& port) {
connection_base::init_socket(socket_, resolver_, hostname, port, resolve_);
Expand Down
15 changes: 4 additions & 11 deletionsboost/network/protocol/http/client/connection/sync_ssl.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,14 +16,7 @@
#include <boost/algorithm/string/predicate.hpp>
#include <boost/network/protocol/http/request.hpp>
#include <boost/network/protocol/http/traits/resolver_policy.hpp>

#ifndef GET_IO_SERVICE
#if BOOST_VERSION >= 107000
#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
#else
#define GET_IO_SERVICE(s) ((s).get_io_service())
#endif
#endif
#include <boost/network/compat.hpp>

namespace boost {
namespace network {
Expand DownExpand Up@@ -68,11 +61,11 @@ struct https_sync_connection
long ssl_options = 0)
: connection_base(),
timeout_(timeout),
timer_(GET_IO_SERVICE(resolver)),
timer_(CPP_NETLIB_ASIO_GET_IO_SERVICE(resolver)),
resolver_(resolver),
resolve_(std::move(resolve)),
context_(GET_IO_SERVICE(resolver), boost::asio::ssl::context::sslv23_client),
socket_(GET_IO_SERVICE(resolver), context_) {
context_(CPP_NETLIB_ASIO_GET_IO_SERVICE(resolver), boost::asio::ssl::context::sslv23_client),
socket_(CPP_NETLIB_ASIO_GET_IO_SERVICE(resolver), context_) {
if (ciphers) {
::SSL_CTX_set_cipher_list(context_.native_handle(), ciphers->c_str());
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp