mirror of
https://github.com/boostorg/mqtt5.git
synced 2025-07-29 20:17:37 +02:00
Do not unlock the connection mutex if the operation was cancelled
Summary: related to T11798 Reviewers: ivica Reviewed By: ivica Subscribers: iljazovic, miljen Differential Revision: https://repo.mireo.local/D27877
This commit is contained in:
@ -67,7 +67,11 @@ public:
|
||||
}
|
||||
|
||||
void operator()(on_locked, typename Owner::stream_ptr s, error_code ec) {
|
||||
if (ec == asio::error::operation_aborted || !_owner.is_open())
|
||||
if (ec == asio::error::operation_aborted)
|
||||
// cancelled without acquiring the lock (by calling client.cancel())
|
||||
return std::move(_handler)(ec);
|
||||
|
||||
if (!_owner.is_open())
|
||||
return complete(asio::error::operation_aborted);
|
||||
|
||||
if (s != _owner._stream_ptr)
|
||||
@ -182,8 +186,7 @@ private:
|
||||
void complete(error_code ec) {
|
||||
get_cancellation_slot().clear();
|
||||
|
||||
if (ec != asio::error::operation_aborted)
|
||||
_owner._conn_mtx.unlock();
|
||||
_owner._conn_mtx.unlock();
|
||||
|
||||
std::move(_handler)(ec);
|
||||
}
|
||||
|
Reference in New Issue
Block a user