Skip to content

Commit

Permalink
Close exchange when session is released (#13448)
Browse files Browse the repository at this point in the history
* Close exchange when session is released

* Add clearRetransTable parameter to DoClose call

Co-authored-by: Andrei Litvin <andy314@gmail.com>
  • Loading branch information
2 people authored and pull[bot] committed Mar 3, 2022
1 parent c8b5b62 commit 5300569
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/messaging/ExchangeContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,18 @@ bool ExchangeContext::MatchExchange(const SessionHandle & session, const PacketH

void ExchangeContext::OnSessionReleased()
{
if (!IsResponseExpected())
ExchangeHandle ref(*this);

if (IsResponseExpected())
{
// Nothing to do in this case
return;
// If we're waiting on a response, we now know it's never going to show up
// and we should notify our delegate accordingly.
CancelResponseTimer();
SetResponseExpected(false);
NotifyResponseTimeout();
}

// If we're waiting on a response, we now know it's never going to show up
// and we should notify our delegate accordingly.
CancelResponseTimer();
SetResponseExpected(false);
NotifyResponseTimeout();
DoClose(true /* clearRetransTable */);
}

CHIP_ERROR ExchangeContext::StartResponseTimer()
Expand Down

0 comments on commit 5300569

Please sign in to comment.