From fe62374849f6e10f522a3610813bf7a7c52970ee Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Thu, 4 Nov 2021 01:28:16 +0800 Subject: [PATCH] Remove UnauthenticatedSession::mLocalMessageCounter (#11375) --- src/transport/SessionManager.cpp | 2 +- src/transport/UnauthenticatedSessionTable.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 82ae6587bbb816..f9a810a6d0d981 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -134,7 +134,7 @@ CHIP_ERROR SessionManager::PrepareMessage(SessionHandle sessionHandle, PayloadHe { ReturnErrorOnFailure(payloadHeader.EncodeBeforeData(message)); - MessageCounter & counter = sessionHandle.GetUnauthenticatedSession()->GetLocalMessageCounter(); + MessageCounter & counter = mGlobalUnencryptedMessageCounter; uint32_t messageCounter = counter.Value(); ReturnErrorOnFailure(counter.Advance()); diff --git a/src/transport/UnauthenticatedSessionTable.h b/src/transport/UnauthenticatedSessionTable.h index e09cb46d89f773..381a7a4a0d64bc 100644 --- a/src/transport/UnauthenticatedSessionTable.h +++ b/src/transport/UnauthenticatedSessionTable.h @@ -47,7 +47,7 @@ class UnauthenticatedSessionDeleter class UnauthenticatedSession : public ReferenceCounted { public: - UnauthenticatedSession(const PeerAddress & address) : mPeerAddress(address) { mLocalMessageCounter.Init(); } + UnauthenticatedSession(const PeerAddress & address) : mPeerAddress(address) {} UnauthenticatedSession(const UnauthenticatedSession &) = delete; UnauthenticatedSession & operator=(const UnauthenticatedSession &) = delete; @@ -59,14 +59,12 @@ class UnauthenticatedSession : public ReferenceCounted