fix for default completion tokens on Boost 1.87.0

Reviewers: ivica

Reviewed By: ivica

Subscribers: korina, miljen

Differential Revision: https://repo.mireo.local/D33181
This commit is contained in:
Bruno Iljazovic
2025-01-14 14:13:23 +01:00
parent 1225cc778a
commit 82a437999a
3 changed files with 17 additions and 8 deletions

View File

@ -111,7 +111,7 @@ public:
}
void operator()(std::array<std::size_t, 3> /* ord */) {
_handler.complete(asio::error::operation_aborted);
_handler.complete(make_error_code(asio::error::operation_aborted));
}
};

View File

@ -66,7 +66,8 @@ public:
/// The client type when rebound to the specified executor.
using other = mqtt_client<
typename detail::rebind_executor<StreamType, Executor>::other,
TlsContext
TlsContext,
LoggerType
>;
};

View File

@ -46,16 +46,20 @@ namespace test {
// the following code needs to compile
template <typename StreamType, typename TlsContextType = std::monostate>
template <
typename StreamType,
typename TlsContextType = std::monostate,
typename Logger = noop_logger
>
asio::awaitable<void> 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<StreamType, TlsContextType>
mqtt_client<StreamType, TlsContextType, Logger>
>;
client_type c(ioc, std::move(tls_context));
client_type c(ioc, std::move(tls_context), std::move(logger));
co_await c.async_run();
@ -96,8 +100,12 @@ asio::awaitable<void> test_default_completion_tokens() {
co_await test_default_completion_tokens_impl<
boost::beast::websocket::stream<asio::ssl::stream<asio::ip::tcp::socket>>,
asio::ssl::context
>(asio::ssl::context(asio::ssl::context::tls_client));
asio::ssl::context,
logger
>(
asio::ssl::context(asio::ssl::context::tls_client),
logger(log_level::debug)
);
}
} // end namespace test