From 3d0b32d75565567ab549638f5d0c1ac4759cbcee Mon Sep 17 00:00:00 2001 From: chendejin Date: Tue, 24 Dec 2024 12:34:31 +0800 Subject: [PATCH] Select least peer active session --- src/transport/SessionManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 5a895e8054c41b..b90972d5dc133b 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -1297,7 +1297,7 @@ Optional SessionManager::FindSecureSessionForNode(ScopedNodeId pe { #if INET_CONFIG_ENABLE_TCP_ENDPOINT // Set up a TCP transport based session as standby - if ((tcpSession == nullptr || tcpSession->GetLastActivityTime() < session->GetLastActivityTime()) && + if ((tcpSession == nullptr || tcpSession->GetLastPeerActivityTime() < session->GetLastPeerActivityTime()) && session->GetTCPConnection() != nullptr) { tcpSession = session; @@ -1305,7 +1305,7 @@ Optional SessionManager::FindSecureSessionForNode(ScopedNodeId pe #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT } - if ((mrpSession == nullptr) || (mrpSession->GetLastActivityTime() < session->GetLastActivityTime())) + if ((mrpSession == nullptr) || (mrpSession->GetLastPeerActivityTime() < session->GetLastPeerActivityTime())) { mrpSession = session; }