From e5de307723f11a29918eea4dcd6a8e6cc2813677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korina=20=C5=A0imi=C4=8Devi=C4=87?= Date: Tue, 13 Feb 2024 13:47:33 +0100 Subject: [PATCH] Remove unnecessary get_cancellation_slot().clear() calls Summary: related to T13706 Reviewers: ivica Reviewed By: ivica Subscribers: miljen, iljazovic Differential Revision: https://repo.mireo.local/D27894 --- include/async_mqtt5/impl/connect_op.hpp | 2 -- include/async_mqtt5/impl/endpoints.hpp | 4 ---- include/async_mqtt5/impl/ping_op.hpp | 4 ---- include/async_mqtt5/impl/reconnect_op.hpp | 3 --- include/async_mqtt5/impl/sentry_op.hpp | 4 ---- test/include/test_common/delayed_op.hpp | 2 -- 6 files changed, 19 deletions(-) diff --git a/include/async_mqtt5/impl/connect_op.hpp b/include/async_mqtt5/impl/connect_op.hpp index 1efb2f3..083e299 100644 --- a/include/async_mqtt5/impl/connect_op.hpp +++ b/include/async_mqtt5/impl/connect_op.hpp @@ -381,8 +381,6 @@ public: private: void complete(error_code ec) { - get_cancellation_slot().clear(); - std::move(_handler)(ec); } diff --git a/include/async_mqtt5/impl/endpoints.hpp b/include/async_mqtt5/impl/endpoints.hpp index 8990554..25c3671 100644 --- a/include/async_mqtt5/impl/endpoints.hpp +++ b/include/async_mqtt5/impl/endpoints.hpp @@ -102,14 +102,10 @@ public: private: void complete(error_code ec, epoints eps, authority_path ap) { - get_cancellation_slot().clear(); - std::move(_handler)(ec, std::move(eps), std::move(ap)); } void complete_post(error_code ec, epoints eps, authority_path ap) { - get_cancellation_slot().clear(); - asio::post( _owner.get_executor(), asio::prepend( diff --git a/include/async_mqtt5/impl/ping_op.hpp b/include/async_mqtt5/impl/ping_op.hpp index 5e6da09..ddeed8b 100644 --- a/include/async_mqtt5/impl/ping_op.hpp +++ b/include/async_mqtt5/impl/ping_op.hpp @@ -67,8 +67,6 @@ public: } void operator()(on_timer, error_code) { - get_cancellation_slot().clear(); - if ( _cancellation_state.cancelled() == asio::cancellation_type::terminal || !_svc_ptr->is_open() @@ -95,8 +93,6 @@ public: } void operator()(on_pingreq, error_code ec) { - get_cancellation_slot().clear(); - if ( _cancellation_state.cancelled() == asio::cancellation_type::terminal || ec == asio::error::no_recovery diff --git a/include/async_mqtt5/impl/reconnect_op.hpp b/include/async_mqtt5/impl/reconnect_op.hpp index b2d7782..80a4672 100644 --- a/include/async_mqtt5/impl/reconnect_op.hpp +++ b/include/async_mqtt5/impl/reconnect_op.hpp @@ -184,10 +184,7 @@ public: private: void complete(error_code ec) { - get_cancellation_slot().clear(); - _owner._conn_mtx.unlock(); - std::move(_handler)(ec); } }; diff --git a/include/async_mqtt5/impl/sentry_op.hpp b/include/async_mqtt5/impl/sentry_op.hpp index 93e7493..14211e4 100644 --- a/include/async_mqtt5/impl/sentry_op.hpp +++ b/include/async_mqtt5/impl/sentry_op.hpp @@ -61,8 +61,6 @@ public: } void operator()(on_timer, error_code ec) { - get_cancellation_slot().clear(); - if (ec == asio::error::operation_aborted || !_svc_ptr->is_open()) return; @@ -81,8 +79,6 @@ public: } void operator()(on_disconnect, error_code ec) { - get_cancellation_slot().clear(); - if (!ec) perform(); } diff --git a/test/include/test_common/delayed_op.hpp b/test/include/test_common/delayed_op.hpp index 65e18d7..1f15a84 100644 --- a/test/include/test_common/delayed_op.hpp +++ b/test/include/test_common/delayed_op.hpp @@ -70,8 +70,6 @@ public: template void operator()(on_timer, CompletionHandler&& h, error_code ec) { - get_cancellation_slot().clear(); - auto bh = std::apply( [h = std::move(h)](auto&&... args) mutable { return asio::append(std::move(h), std::move(args)...);