Skip to content

Commit 3b248ba

Browse files
Fix MRP baseTimeout calculation when it is possible the other end fall asleep
1 parent 35fda6d commit 3b248ba

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

src/messaging/ReliableMessageProtocolConfig.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ System::Clock::Timeout GetRetransmissionTimeout(System::Clock::Timeout activeInt
135135
System::Clock::Timestamp timeout(0);
136136
for (uint8_t i = 0; i < CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS + 1; i++)
137137
{
138-
auto baseInterval = ((timeSinceLastActivity + timeout) < activityThreshold) ? activeInterval : idleInterval;
138+
auto baseInterval = activeInterval;
139139
timeout += Messaging::ReliableMessageMgr::GetBackoff(baseInterval, i, /* computeMaxPossible */ true);
140140
}
141141

src/transport/SecureSession.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,7 @@ class SecureSession : public Session, public ReferenceCounted<SecureSession, Sec
263263
GetRemoteMRPConfig().mActiveThresholdTime);
264264
}
265265

266-
System::Clock::Timestamp GetMRPBaseTimeout() const override
267-
{
268-
return IsPeerActive() ? GetRemoteMRPConfig().mActiveRetransTimeout : GetRemoteMRPConfig().mIdleRetransTimeout;
269-
}
266+
System::Clock::Timestamp GetMRPBaseTimeout() const override { return GetRemoteMRPConfig().mActiveRetransTimeout; }
270267

271268
CryptoContext & GetCryptoContext() { return mCryptoContext; }
272269

src/transport/UnauthenticatedSessionTable.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,7 @@ class UnauthenticatedSession : public Session, public ReferenceCounted<Unauthent
153153
GetRemoteMRPConfig().mActiveThresholdTime);
154154
}
155155

156-
System::Clock::Timestamp GetMRPBaseTimeout() const override
157-
{
158-
return IsPeerActive() ? GetRemoteMRPConfig().mActiveRetransTimeout : GetRemoteMRPConfig().mIdleRetransTimeout;
159-
}
156+
System::Clock::Timestamp GetMRPBaseTimeout() const override { return GetRemoteMRPConfig().mActiveRetransTimeout; }
160157

161158
void SetRemoteSessionParameters(const SessionParameters & sessionParams) { mRemoteSessionParams = sessionParams; }
162159

0 commit comments

Comments
 (0)