From ef98b0220d4de4535d9bf10dfde536c19afc3517 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 1 Mar 2022 11:44:28 +0100 Subject: Fixes for ASIO 1.20.0 --- src/lib/util/client_ws.hpp | 5 +++-- src/lib/util/client_wss.hpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/util/client_ws.hpp b/src/lib/util/client_ws.hpp index f3c4ded6bb2..8f093d2b132 100644 --- a/src/lib/util/client_ws.hpp +++ b/src/lib/util/client_ws.hpp @@ -11,6 +11,7 @@ #include #include #include "crypto.hpp" +#include "base64.hpp" #ifndef CASE_INSENSITIVE_EQUALS_AND_HASH #define CASE_INSENSITIVE_EQUALS_AND_HASH @@ -65,7 +66,7 @@ namespace webpp { unsigned short remote_endpoint_port; private: - explicit Connection(socket_type* socket): remote_endpoint_port(0), socket(socket), strand(socket->get_io_context()), closed(false) { } + explicit Connection(asio::io_context &context, socket_type* socket): remote_endpoint_port(0), socket(socket), strand(context), closed(false) { } class SendData { public: @@ -488,7 +489,7 @@ namespace webpp { resolver->async_resolve(query, [this] (const std::error_code &ec, asio::ip::tcp::resolver::iterator it){ if(!ec) { - connection=std::shared_ptr(new Connection(new WS(*io_context))); + connection=std::shared_ptr(new Connection(*io_context, new WS(*io_context))); asio::async_connect(*connection->socket, it, [this] (const std::error_code &ec, asio::ip::tcp::resolver::iterator /*it*/){ diff --git a/src/lib/util/client_wss.hpp b/src/lib/util/client_wss.hpp index 6ff51658f30..128394f5f4e 100644 --- a/src/lib/util/client_wss.hpp +++ b/src/lib/util/client_wss.hpp @@ -45,7 +45,7 @@ namespace webpp { resolver->async_resolve(query, [this] (const std::error_code &ec, asio::ip::tcp::resolver::iterator it){ if(!ec) { - connection=std::shared_ptr(new Connection(new WSS(*io_context, context))); + connection=std::shared_ptr(new Connection(*io_context, new WSS(*io_context, context))); asio::async_connect(connection->socket->lowest_layer(), it, [this] (const std::error_code &ec, asio::ip::tcp::resolver::iterator /*it*/){ -- cgit v1.2.3