From 1225cc778a89b86e2203cb73437e249d5a18b3cb Mon Sep 17 00:00:00 2001 From: Bruno Iljazovic Date: Thu, 12 Dec 2024 17:11:52 +0100 Subject: [PATCH] fix for Boost 1.87.0 Summary: Boost.Asio made basic_resolver_results' inheritance of basic_resolver_iterator private Reviewers: ivica Reviewed By: ivica Subscribers: korina, miljen Differential Revision: https://repo.mireo.local/D32797 --- include/async_mqtt5/impl/reconnect_op.hpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/include/async_mqtt5/impl/reconnect_op.hpp b/include/async_mqtt5/impl/reconnect_op.hpp index 38341b3..91323b9 100644 --- a/include/async_mqtt5/impl/reconnect_op.hpp +++ b/include/async_mqtt5/impl/reconnect_op.hpp @@ -160,15 +160,12 @@ class reconnect_op { if (ec == asio::error::host_not_found) return complete(asio::error::no_recovery); - connect(std::move(eps), std::move(ap)); + connect(eps.cbegin(), std::move(ap)); } - void connect(epoints eps, authority_path ap) { + void connect(epoints::const_iterator eps, authority_path ap) { namespace asioex = boost::asio::experimental; - if (eps.empty()) - return do_reconnect(); - const auto& ep = eps->endpoint(); auto sptr = _owner.construct_and_open_next_layer(ep.protocol()); @@ -210,7 +207,7 @@ class reconnect_op { void operator()( on_connect, - typename Owner::stream_ptr sptr, epoints eps, authority_path ap, + typename Owner::stream_ptr sptr, epoints::const_iterator eps, authority_path ap, std::array ord, error_code connect_ec, error_code timer_ec ) { @@ -231,7 +228,7 @@ class reconnect_op { // retry for operation timed out and any other error_code or client::error::malformed_packet if (ord[0] == 1 || connect_ec) { // if the hostname resolved into more endpoints, try the next one - if (++eps != eps.end()) + if (++eps != epoints::const_iterator()) return connect(std::move(eps), std::move(ap)); // try next server return do_reconnect();