Commit b6284120c4ae8d362cccf012a80f550a84c8e570

Authored by Wiebe Cazemier
1 parent f3a196e3

Print clean session / clean start in client repr

Showing 2 changed files with 4 additions and 2 deletions
client.cpp
@@ -321,9 +321,9 @@ bool Client::writeBufIntoFd() @@ -321,9 +321,9 @@ bool Client::writeBufIntoFd()
321 321
322 std::string Client::repr() 322 std::string Client::repr()
323 { 323 {
324 - std::string s = formatString("[ClientID='%s', username='%s', fd=%d, keepalive=%ds, transport='%s', address='%s', prot=%s]", 324 + std::string s = formatString("[ClientID='%s', username='%s', fd=%d, keepalive=%ds, transport='%s', address='%s', prot=%s, clean=%d]",
325 clientid.c_str(), username.c_str(), fd, keepalive, this->transportStr.c_str(), this->address.c_str(), 325 clientid.c_str(), username.c_str(), fd, keepalive, this->transportStr.c_str(), this->address.c_str(),
326 - protocolVersionString(protocolVersion).c_str()); 326 + protocolVersionString(protocolVersion).c_str(), this->clean_start);
327 return s; 327 return s;
328 } 328 }
329 329
@@ -450,6 +450,7 @@ void Client::serverInitiatedDisconnect(ReasonCodes reason) @@ -450,6 +450,7 @@ void Client::serverInitiatedDisconnect(ReasonCodes reason)
450 */ 450 */
451 void Client::setRegistrationData(bool clean_start, uint16_t client_receive_max, uint32_t sessionExpiryInterval) 451 void Client::setRegistrationData(bool clean_start, uint16_t client_receive_max, uint32_t sessionExpiryInterval)
452 { 452 {
  453 + this->clean_start = clean_start;
453 this->registrationData = std::make_unique<StowedClientRegistrationData>(clean_start, client_receive_max, sessionExpiryInterval); 454 this->registrationData = std::make_unique<StowedClientRegistrationData>(clean_start, client_receive_max, sessionExpiryInterval);
454 } 455 }
455 456
client.h
@@ -88,6 +88,7 @@ class Client @@ -88,6 +88,7 @@ class Client
88 std::string clientid; 88 std::string clientid;
89 std::string username; 89 std::string username;
90 uint16_t keepalive = 0; 90 uint16_t keepalive = 0;
  91 + bool clean_start = false;
91 92
92 std::shared_ptr<WillPublish> willPublish; 93 std::shared_ptr<WillPublish> willPublish;
93 94