Skip to content

Commit

Permalink
[session] Fix #20649 - initialize active and session timestamps on se…
Browse files Browse the repository at this point in the history
…ssion creation. (#20651)
  • Loading branch information
turon authored and pull[bot] committed Jul 31, 2023
1 parent d165722 commit 1224196
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/transport/SecureSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void SecureSession::Activate(const ScopedNodeId & localNode, const ScopedNodeId
mPeerSessionId = peerSessionId;
mRemoteMRPConfig = config;
SetFabricIndex(peerNode.GetFabricIndex());
MarkActiveRx(); // Initialize SessionTimestamp and ActiveTimestamp per spec.

Retain(); // This ref is released inside MarkForEviction
MoveToState(State::kActive);
Expand Down
9 changes: 7 additions & 2 deletions src/transport/SecureSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,13 @@ class SecureSession : public Session, public ReferenceCounted<SecureSession, Sec
uint16_t mPeerSessionId = 0;

PeerAddress mPeerAddress;
System::Clock::Timestamp mLastActivityTime = System::SystemClock().GetMonotonicTimestamp(); ///< Timestamp of last tx or rx
System::Clock::Timestamp mLastPeerActivityTime = System::SystemClock().GetMonotonicTimestamp(); ///< Timestamp of last rx

/// Timestamp of last tx or rx. @see SessionTimestamp in the spec
System::Clock::Timestamp mLastActivityTime = System::SystemClock().GetMonotonicTimestamp();

/// Timestamp of last rx. @see ActiveTimestamp in the spec
System::Clock::Timestamp mLastPeerActivityTime = System::SystemClock().GetMonotonicTimestamp();

ReliableMessageProtocolConfig mRemoteMRPConfig = GetDefaultMRPConfig();
CryptoContext mCryptoContext;
SessionMessageCounter mSessionMessageCounter;
Expand Down

0 comments on commit 1224196

Please sign in to comment.