epee: fix build with boost 1.70.0

get_io_service was deprecated, and got removed
This commit is contained in:
moneromooo-monero 2019-03-21 11:01:15 +00:00
parent d6d6c46c4d
commit 17769db946
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
2 changed files with 19 additions and 7 deletions

View file

@ -47,6 +47,12 @@
// TODO:
#include "net/network_throttle-detail.hpp"
#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
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.conn"
@ -117,8 +123,8 @@ connection_basic::connection_basic(boost::asio::ip::tcp::socket&& sock, boost::s
:
m_stats(std::move(stats)),
mI( new connection_basic_pimpl("peer") ),
strand_(sock.get_io_service()),
socket_(sock.get_io_service(), ssl_context.context),
strand_(GET_IO_SERVICE(sock)),
socket_(GET_IO_SERVICE(sock), ssl_context.context),
m_want_close_connection(false),
m_was_shutdown(false),
m_ssl_support(ssl_support),