Skip to content

Commit 8997821

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

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
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-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class SecureSession : public Session, public ReferenceCounted<SecureSession, Sec
265265

266266
System::Clock::Timestamp GetMRPBaseTimeout() const override
267267
{
268-
return IsPeerActive() ? GetRemoteMRPConfig().mActiveRetransTimeout : GetRemoteMRPConfig().mIdleRetransTimeout;
268+
return GetRemoteMRPConfig().mActiveRetransTimeout;
269269
}
270270

271271
CryptoContext & GetCryptoContext() { return mCryptoContext; }

src/transport/UnauthenticatedSessionTable.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class UnauthenticatedSession : public Session, public ReferenceCounted<Unauthent
155155

156156
System::Clock::Timestamp GetMRPBaseTimeout() const override
157157
{
158-
return IsPeerActive() ? GetRemoteMRPConfig().mActiveRetransTimeout : GetRemoteMRPConfig().mIdleRetransTimeout;
158+
return GetRemoteMRPConfig().mActiveRetransTimeout;
159159
}
160160

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

0 commit comments

Comments
 (0)