Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit a2729db

Browse files
authored
Merge pull request #363 from openweave/bug/ReconnectConnState
Ensure WeaveTunnelConnectionManager is in correct state before trying to reconnect when timer fires.
2 parents 220b97b + 2d66754 commit a2729db

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/lib/profiles/weave-tunneling/WeaveTunnelConnectionMgr.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,13 @@ void WeaveTunnelConnectionMgr::ServiceConnectTimeout(System::Layer* aSystemLayer
422422
ExitNow();
423423
}
424424

425-
/* Check if the WeaveConnectionManager is in the correct state to effect a
425+
/* Ensure that the WeaveConnectionManager is in the correct state to effect a
426426
* reconnect.
427427
*/
428-
VerifyOrExit(tConnMgr->mConnectionState == kState_NotConnected,
429-
/* NO_OP */);
428+
if (tConnMgr->mConnectionState != kState_NotConnected)
429+
{
430+
tConnMgr->StopServiceTunnelConn(WEAVE_ERROR_TUNNEL_FORCE_ABORT);
431+
}
430432

431433
// Reconnect to Service.
432434

src/test-apps/TestWeaveTunnelBR.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ static void TestTunnelNoStatusReportResetReconnectBackoff(nlTestSuite *inSuite,
11071107
gTestSucceeded = false;
11081108
/* Set the test timeout to be a little longer than the Tunnel Control ExchangeContext
11091109
* timeout */
1110-
gMaxTestDurationMillisecs = (WEAVE_CONFIG_TUNNELING_CTRL_RESPONSE_TIMEOUT_SECS + 1 ) * System::kTimerFactor_milli_per_unit;
1110+
gMaxTestDurationMillisecs = (WEAVE_CONFIG_TUNNELING_CTRL_RESPONSE_TIMEOUT_SECS + 5 ) * System::kTimerFactor_milli_per_unit;
11111111
gCurrTestNum = kTestNum_TestTunnelNoStatusReportResetReconnectBackoff;
11121112
gTestStartTime = Now();
11131113

0 commit comments

Comments
 (0)