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 <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jul 22, 2023
1 parent 21aa0e4 commit e3f8af4
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 e3f8af4

Please sign in to comment.