Skip to content

Commit

Permalink
Removed removing pending notification on connect failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kkasperczyk-no committed Apr 25, 2022
1 parent de0c1d7 commit 9923d67
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/app/clusters/bindings/BindingManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,33 +186,6 @@ void BindingManager::HandleDeviceConnectionFailure(PeerId peerId, CHIP_ERROR err
{
// Simply release the entry, the connection will be re-established as needed.
ChipLogError(AppServer, "Failed to establish connection to node 0x" ChipLogFormatX64, ChipLogValueX64(peerId.GetNodeId()));

FabricIndex fabricToRemove = kUndefinedFabricIndex;
NodeId nodeToRemove = kUndefinedNodeId;

for (PendingNotificationEntry pendingNotification : mPendingNotificationMap)
{
EmberBindingTableEntry entry = BindingTable::GetInstance().GetAt(pendingNotification.mBindingEntryId);

PeerId peer = PeerIdForNode(mInitParams.mFabricTable, entry.fabricIndex, entry.nodeId);

if (peerId == peer)
{
fabricToRemove = entry.fabricIndex;
nodeToRemove = entry.nodeId;

BindingManagerContext * context = static_cast<BindingManagerContext *>(pendingNotification.mContext);

context->DecrementConsumersNumber();
if (context->GetConsumersNumber() == 0)
{
mBoundDeviceContextReleaseHandler(context->GetContext());
Platform::Delete(context);
}
}
}
mPendingNotificationMap.RemoveAllEntriesForNode(fabricToRemove, nodeToRemove);

mInitParams.mCASESessionManager->ReleaseSession(peerId);
}

Expand Down

0 comments on commit 9923d67

Please sign in to comment.