mirror of
https://github.com/boostorg/mqtt5.git
synced 2025-10-04 04:40:55 +02:00
[mqtt-client] user can only async_disconnect with rcs < 0x80, fix async_disconnect ecs
Summary: resolves T12974 Reviewers: ivica Reviewed By: ivica Subscribers: miljen, iljazovic Maniphest Tasks: T12974 Differential Revision: https://repo.mireo.local/D26294
This commit is contained in:
@@ -80,14 +80,12 @@ public:
|
||||
// The connection must be closed even
|
||||
// if we failed to send the DISCONNECT packet
|
||||
// with Reason Code of 0x80 or greater.
|
||||
// TODO: what about rc < 0x80?
|
||||
|
||||
if (
|
||||
ec == asio::error::operation_aborted ||
|
||||
ec == asio::error::no_recovery
|
||||
)
|
||||
// TODO: do we need two different errors here?
|
||||
return complete(ec);
|
||||
return complete(asio::error::operation_aborted);
|
||||
|
||||
if (_context.terminal) {
|
||||
_svc_ptr->cancel();
|
||||
@@ -95,7 +93,7 @@ public:
|
||||
}
|
||||
|
||||
if (ec == asio::error::try_again)
|
||||
return complete(ec);
|
||||
return complete(error_code {});
|
||||
|
||||
_svc_ptr->close_stream();
|
||||
_svc_ptr->open_stream();
|
||||
|
Reference in New Issue
Block a user