diff --git a/session.cpp b/session.cpp index 5cf9280..eb080c4 100644 --- a/session.cpp +++ b/session.cpp @@ -70,6 +70,7 @@ Session::Session(const Session &other) this->incomingQoS2MessageIds = other.incomingQoS2MessageIds; this->outgoingQoS2MessageIds = other.outgoingQoS2MessageIds; this->nextPacketId = other.nextPacketId; + this->sessionExpiryInterval = other.sessionExpiryInterval; // TODO: see git history for a change here. We now copy the whole queued publish. Do we want to address that? this->qosPacketQueue = other.qosPacketQueue; @@ -246,6 +247,7 @@ uint64_t Session::sendPendingQosMessages() pos = qosPacketQueue.erase(pos); continue; } + pos++; MqttPacket p(c->getProtocolVersion(), pub); p.setDuplicate(); diff --git a/sessionsandsubscriptionsdb.cpp b/sessionsandsubscriptionsdb.cpp index 5d65923..ec14b52 100644 --- a/sessionsandsubscriptionsdb.cpp +++ b/sessionsandsubscriptionsdb.cpp @@ -132,7 +132,7 @@ SessionsAndSubscriptionsResult SessionsAndSubscriptionsDB::readDataV2() const uint32_t newPubAge = persistence_state_age + originalPubAge; pub.setCreatedAt(timepointFromAge(newPubAge)); - logger->logf(LOG_DEBUG, "Loaded QoS %d message for topic '%s'.", pub.qos, pub.topic.c_str()); + logger->logf(LOG_DEBUG, "Loaded QoS %d message for topic '%s' for session '%s'.", pub.qos, pub.topic.c_str(), ses->getClientId().c_str()); ses->qosPacketQueue.queuePublish(std::move(pub), id); }