fix: orca mqtt session timeout after connack

This commit is contained in:
Ian Chua
2026-09-28 21:14:21 +08:00
parent 87eb8de001
commit b36a72e16a
+3
View File
@@ -569,6 +569,9 @@ void OrcaMqttConnection::connect_and_read() {
ws_read(*connection, buffer, connack_error);
if (connack_error)
throw boost::system::system_error(connack_error, "read Orca MQTT CONNACK");
// Beast leaves this expiry armed after the synchronous CONNACK read above;
// disable it before starting the long-lived async WebSocket session.
expires_never(*connection);
const std::string connack = boost::beast::buffers_to_string(buffer.data());
// rc: 0 accepted, 1..5 refusal, -1 malformed/not a CONNACK.
const int rc = (connack.size() == 4 && static_cast<uint8_t>(connack[0]) == 0x20)