Commit 0383322953d8125750cdd5fc262eca8f54c89655

Authored by Patric Stout
1 parent 87fe34d7

fix: the given ClientID was ignored during connection setup

Showing 1 changed file with 1 additions and 2 deletions
src/Packet.cpp
@@ -362,7 +362,6 @@ void TrueMQTT::Client::Impl::Connection::sendConnect() @@ -362,7 +362,6 @@ void TrueMQTT::Client::Impl::Connection::sendConnect()
362 LOG_TRACE(&m_impl, "Sending CONNECT packet"); 362 LOG_TRACE(&m_impl, "Sending CONNECT packet");
363 363
364 static std::string protocol_name("MQTT"); 364 static std::string protocol_name("MQTT");
365 - static std::string client_id("ClientID");  
366 365
367 uint8_t flags = 0; 366 uint8_t flags = 0;
368 flags |= 1 << 1; // Clean session 367 flags |= 1 << 1; // Clean session
@@ -385,7 +384,7 @@ void TrueMQTT::Client::Impl::Connection::sendConnect() @@ -385,7 +384,7 @@ void TrueMQTT::Client::Impl::Connection::sendConnect()
385 packet.write_uint8(flags); 384 packet.write_uint8(flags);
386 packet.write_uint16(30); // Keep-alive 385 packet.write_uint16(30); // Keep-alive
387 386
388 - packet.write_string(client_id); // Client ID 387 + packet.write_string(m_impl.m_client_id);
389 if (!m_impl.m_last_will_topic.empty()) 388 if (!m_impl.m_last_will_topic.empty())
390 { 389 {
391 packet.write_string(m_impl.m_last_will_topic); 390 packet.write_string(m_impl.m_last_will_topic);