mirror of
https://github.com/monero-project/monero.git
synced 2025-08-15 17:00:23 -04:00
Fix build with boost ASIO 0.87. Support boost 1.66+
This commit is contained in:
parent
23a11d851a
commit
01bcd52924
37 changed files with 400 additions and 494 deletions
|
@ -32,7 +32,7 @@
|
|||
#include <boost/archive/portable_binary_oarchive.hpp>
|
||||
#include <boost/archive/portable_binary_iarchive.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <boost/asio/read.hpp>
|
||||
#include <boost/asio/steady_timer.hpp>
|
||||
|
@ -972,8 +972,8 @@ namespace
|
|||
|
||||
struct io_thread
|
||||
{
|
||||
boost::asio::io_service io_service;
|
||||
boost::asio::io_service::work work;
|
||||
boost::asio::io_context io_service;
|
||||
boost::asio::executor_work_guard<boost::asio::io_context::executor_type> work;
|
||||
stream_type::socket server;
|
||||
stream_type::acceptor acceptor;
|
||||
boost::thread io;
|
||||
|
@ -981,7 +981,7 @@ namespace
|
|||
|
||||
io_thread()
|
||||
: io_service(),
|
||||
work(io_service),
|
||||
work(io_service.get_executor()),
|
||||
server(io_service),
|
||||
acceptor(io_service),
|
||||
io([this] () { try { this->io_service.run(); } catch (const std::exception& e) { MERROR(e.what()); }}),
|
||||
|
@ -1021,7 +1021,7 @@ namespace
|
|||
|
||||
TEST(socks_client, unsupported_command)
|
||||
{
|
||||
boost::asio::io_service io_service{};
|
||||
boost::asio::io_context io_service{};
|
||||
stream_type::socket client{io_service};
|
||||
|
||||
auto test_client = net::socks::make_connect_client(
|
||||
|
@ -1039,7 +1039,7 @@ TEST(socks_client, unsupported_command)
|
|||
|
||||
TEST(socks_client, no_command)
|
||||
{
|
||||
boost::asio::io_service io_service{};
|
||||
boost::asio::io_context io_service{};
|
||||
stream_type::socket client{io_service};
|
||||
|
||||
auto test_client = net::socks::make_connect_client(
|
||||
|
@ -1193,7 +1193,7 @@ TEST(socks_connector, host)
|
|||
{
|
||||
io_thread io{};
|
||||
boost::asio::steady_timer timeout{io.io_service};
|
||||
timeout.expires_from_now(std::chrono::seconds{5});
|
||||
timeout.expires_after(std::chrono::seconds{5});
|
||||
|
||||
boost::unique_future<boost::asio::ip::tcp::socket> sock =
|
||||
net::socks::connector{io.acceptor.local_endpoint()}("example.com", "8080", timeout);
|
||||
|
@ -1220,7 +1220,7 @@ TEST(socks_connector, ipv4)
|
|||
{
|
||||
io_thread io{};
|
||||
boost::asio::steady_timer timeout{io.io_service};
|
||||
timeout.expires_from_now(std::chrono::seconds{5});
|
||||
timeout.expires_after(std::chrono::seconds{5});
|
||||
|
||||
boost::unique_future<boost::asio::ip::tcp::socket> sock =
|
||||
net::socks::connector{io.acceptor.local_endpoint()}("250.88.125.99", "8080", timeout);
|
||||
|
@ -1246,7 +1246,7 @@ TEST(socks_connector, error)
|
|||
{
|
||||
io_thread io{};
|
||||
boost::asio::steady_timer timeout{io.io_service};
|
||||
timeout.expires_from_now(std::chrono::seconds{5});
|
||||
timeout.expires_after(std::chrono::seconds{5});
|
||||
|
||||
boost::unique_future<boost::asio::ip::tcp::socket> sock =
|
||||
net::socks::connector{io.acceptor.local_endpoint()}("250.88.125.99", "8080", timeout);
|
||||
|
@ -1272,7 +1272,7 @@ TEST(socks_connector, timeout)
|
|||
{
|
||||
io_thread io{};
|
||||
boost::asio::steady_timer timeout{io.io_service};
|
||||
timeout.expires_from_now(std::chrono::milliseconds{10});
|
||||
timeout.expires_after(std::chrono::milliseconds{10});
|
||||
|
||||
boost::unique_future<boost::asio::ip::tcp::socket> sock =
|
||||
net::socks::connector{io.acceptor.local_endpoint()}("250.88.125.99", "8080", timeout);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue