From acae28c9b038406f38947d5310e670128d389808 Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Wed, 3 Nov 2021 23:02:05 +0800 Subject: [PATCH] Remove UnauthenticatedSession::mLocalMessageCounter --- 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 eb063494e0dc05..8e8eca24e4fb17 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