From b6284120c4ae8d362cccf012a80f550a84c8e570 Mon Sep 17 00:00:00 2001 From: Wiebe Cazemier Date: Mon, 2 May 2022 21:30:04 +0200 Subject: [PATCH] Print clean session / clean start in client repr --- client.cpp | 5 +++-- client.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client.cpp b/client.cpp index 3a457ee..629d618 100644 --- a/client.cpp +++ b/client.cpp @@ -321,9 +321,9 @@ bool Client::writeBufIntoFd() std::string Client::repr() { - std::string s = formatString("[ClientID='%s', username='%s', fd=%d, keepalive=%ds, transport='%s', address='%s', prot=%s]", + std::string s = formatString("[ClientID='%s', username='%s', fd=%d, keepalive=%ds, transport='%s', address='%s', prot=%s, clean=%d]", clientid.c_str(), username.c_str(), fd, keepalive, this->transportStr.c_str(), this->address.c_str(), - protocolVersionString(protocolVersion).c_str()); + protocolVersionString(protocolVersion).c_str(), this->clean_start); return s; } @@ -450,6 +450,7 @@ void Client::serverInitiatedDisconnect(ReasonCodes reason) */ void Client::setRegistrationData(bool clean_start, uint16_t client_receive_max, uint32_t sessionExpiryInterval) { + this->clean_start = clean_start; this->registrationData = std::make_unique(clean_start, client_receive_max, sessionExpiryInterval); } diff --git a/client.h b/client.h index 7a2561a..33eb457 100644 --- a/client.h +++ b/client.h @@ -88,6 +88,7 @@ class Client std::string clientid; std::string username; uint16_t keepalive = 0; + bool clean_start = false; std::shared_ptr willPublish; -- libgit2 0.21.4