diff --git a/include/boost/mqtt5/impl/run_op.hpp b/include/boost/mqtt5/impl/run_op.hpp index a747454..725e36e 100644 --- a/include/boost/mqtt5/impl/run_op.hpp +++ b/include/boost/mqtt5/impl/run_op.hpp @@ -111,7 +111,7 @@ public: } void operator()(std::array /* ord */) { - _handler.complete(asio::error::operation_aborted); + _handler.complete(make_error_code(asio::error::operation_aborted)); } }; diff --git a/include/boost/mqtt5/mqtt_client.hpp b/include/boost/mqtt5/mqtt_client.hpp index 048a7fc..65e9520 100644 --- a/include/boost/mqtt5/mqtt_client.hpp +++ b/include/boost/mqtt5/mqtt_client.hpp @@ -66,7 +66,8 @@ public: /// The client type when rebound to the specified executor. using other = mqtt_client< typename detail::rebind_executor::other, - TlsContext + TlsContext, + LoggerType >; }; diff --git a/test/unit/default_completion_tokens.cpp b/test/unit/default_completion_tokens.cpp index 968af34..8465d7b 100644 --- a/test/unit/default_completion_tokens.cpp +++ b/test/unit/default_completion_tokens.cpp @@ -46,16 +46,20 @@ namespace test { // the following code needs to compile -template +template < + typename StreamType, + typename TlsContextType = std::monostate, + typename Logger = noop_logger +> asio::awaitable test_default_completion_tokens_impl( - TlsContextType tls_context = {} + TlsContextType tls_context = {}, Logger logger = {} ) { asio::io_context ioc; - using client_type = asio::use_awaitable_t<>::as_default_on_t< - mqtt_client - >; - client_type c(ioc, std::move(tls_context)); + using client_type = asio::use_awaitable_t<>::as_default_on_t< + mqtt_client + >; + client_type c(ioc, std::move(tls_context), std::move(logger)); co_await c.async_run(); @@ -94,10 +98,14 @@ asio::awaitable test_default_completion_tokens() { boost::beast::websocket::stream >(); - co_await test_default_completion_tokens_impl< - boost::beast::websocket::stream>, - asio::ssl::context - >(asio::ssl::context(asio::ssl::context::tls_client)); + co_await test_default_completion_tokens_impl< + boost::beast::websocket::stream>, + asio::ssl::context, + logger + >( + asio::ssl::context(asio::ssl::context::tls_client), + logger(log_level::debug) + ); } } // end namespace test