mirror of
https://github.com/boostorg/mqtt5.git
synced 2025-11-06 10:51:37 +01:00
Reconnect on every Reason Code > 0x80 received in the CONNACK packet
Summary: related to T13767 Reviewers: ivica Reviewed By: ivica Subscribers: miljen, iljazovic Differential Revision: https://repo.mireo.local/D28217
This commit is contained in:
@@ -327,9 +327,8 @@ public:
|
||||
if (!rc.has_value()) // reason code not allowed in CONNACK
|
||||
return complete(client::error::malformed_packet);
|
||||
|
||||
auto ec = to_asio_error(*rc);
|
||||
if (ec)
|
||||
return complete(ec);
|
||||
if (*rc)
|
||||
return complete(asio::error::try_again);
|
||||
|
||||
if (_ctx.co_props[prop::authentication_method].has_value())
|
||||
return _ctx.authenticator.async_auth(
|
||||
@@ -425,20 +424,6 @@ private:
|
||||
_cancellation_state.slot().clear();
|
||||
std::move(_handler)(ec);
|
||||
}
|
||||
|
||||
static error_code to_asio_error(reason_code rc) {
|
||||
using namespace boost::asio::error;
|
||||
using namespace reason_codes;
|
||||
|
||||
if (rc == success)
|
||||
return {};
|
||||
|
||||
if (rc == unspecified_error || rc == server_unavailable ||
|
||||
rc == server_busy || rc == connection_rate_exceeded)
|
||||
return connection_refused;
|
||||
|
||||
return access_denied;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user