From 0383322953d8125750cdd5fc262eca8f54c89655 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Tue, 20 Sep 2022 19:29:07 +0200 Subject: [PATCH] fix: the given ClientID was ignored during connection setup --- src/Packet.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Packet.cpp b/src/Packet.cpp index b967135..3c8ea12 100644 --- a/src/Packet.cpp +++ b/src/Packet.cpp @@ -362,7 +362,6 @@ void TrueMQTT::Client::Impl::Connection::sendConnect() LOG_TRACE(&m_impl, "Sending CONNECT packet"); static std::string protocol_name("MQTT"); - static std::string client_id("ClientID"); uint8_t flags = 0; flags |= 1 << 1; // Clean session @@ -385,7 +384,7 @@ void TrueMQTT::Client::Impl::Connection::sendConnect() packet.write_uint8(flags); packet.write_uint16(30); // Keep-alive - packet.write_string(client_id); // Client ID + packet.write_string(m_impl.m_client_id); if (!m_impl.m_last_will_topic.empty()) { packet.write_string(m_impl.m_last_will_topic); -- libgit2 0.21.4