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 362 LOG_TRACE(&m_impl, "Sending CONNECT packet");
363 363  
364 364 static std::string protocol_name("MQTT");
365   - static std::string client_id("ClientID");
366 365  
367 366 uint8_t flags = 0;
368 367 flags |= 1 << 1; // Clean session
... ... @@ -385,7 +384,7 @@ void TrueMQTT::Client::Impl::Connection::sendConnect()
385 384 packet.write_uint8(flags);
386 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 388 if (!m_impl.m_last_will_topic.empty())
390 389 {
391 390 packet.write_string(m_impl.m_last_will_topic);
... ...