mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-30 12:21:05 +00:00
fix: orca mqtt session timeout after connack
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user