Skip to content

Commit

Permalink
Resolve comments: adjust function name
Browse files Browse the repository at this point in the history
  • Loading branch information
kghost committed Jun 17, 2022
1 parent ca00d21 commit 3c7158f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 23 deletions.
18 changes: 2 additions & 16 deletions src/messaging/ExchangeMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,26 +376,12 @@ void ExchangeManager::CloseAllContextsForDelegate(const ExchangeDelegate * deleg
});
}

void ExchangeManager::AbortExchangeForFabricExceptOne(FabricIndex fabricIndex, ExchangeContext * exception)
void ExchangeManager::AbortExchangesForFabricExceptOne(FabricIndex fabricIndex, ExchangeContext * deferred)
{
mContextPool.ForEachActiveObject([&](auto * ec) {
if (ec->HasSessionHandle() && ec->GetSessionHandle()->GetPeer().GetFabricIndex() == fabricIndex)
{
if (ec == exception)
ec->SetAutoReleaseSession();
else
ec->Abort();
}
return Loop::Continue;
});
}

void ExchangeManager::AbortExchangeForNodeExceptOne(const ScopedNodeId & node, ExchangeContext * exception)
{
mContextPool.ForEachActiveObject([&](auto * ec) {
if (ec->HasSessionHandle() && ec->GetSessionHandle()->GetPeer() == node)
{
if (ec == exception)
if (ec == deferred)
ec->SetAutoReleaseSession();
else
ec->Abort();
Expand Down
6 changes: 3 additions & 3 deletions src/messaging/ExchangeMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ class DLL_EXPORT ExchangeManager : public SessionMessageDelegate
*/
void CloseAllContextsForDelegate(const ExchangeDelegate * delegate);

// This 2 APIs are used by UpdateNOC command, to invalid all exchanges except the given one.
void AbortExchangeForFabricExceptOne(FabricIndex fabricIndex, ExchangeContext * exception);
void AbortExchangeForNodeExceptOne(const ScopedNodeId & node, ExchangeContext * exception);
// This API is used by UpdateNOC command, to abort all exchanges except the given one, whose abort is deferred until UpdateNOC
// command finishing its work.
void AbortExchangesForFabricExceptOne(FabricIndex fabricIndex, ExchangeContext * deferred);

SessionManager * GetSessionManager() const { return mSessionManager; }

Expand Down
2 changes: 1 addition & 1 deletion src/transport/SessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ void SessionManager::ExpireAllPASEPairings()
});
}

void SessionManager::ReleaseSessionForFabricExceptOne(FabricIndex fabricIndex, const SessionHandle & exception)
void SessionManager::ReleaseSessionsForFabricExceptOne(FabricIndex fabricIndex, const SessionHandle & deferred)
{
mSecureSessions.ForEachSession([&](auto session) {
if (session->GetPeer().GetFabricIndex() == fabricIndex)
Expand Down
6 changes: 3 additions & 3 deletions src/transport/SessionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate
void ExpireAllPairingsForFabric(FabricIndex fabric);
void ExpireAllPASEPairings();

// This API is used by UpdateNOC command, to invalid all sessions except the given one.
void ReleaseSessionForFabricExceptOne(FabricIndex fabricIndex, const SessionHandle & exception);
void ReleaseSessionForNodeExceptOne(const ScopedNodeId & node, const SessionHandle & exception);
// This API is used by UpdateNOC command, to invalidate all sessions except the given one, whose release is deferred until
// UpdateNOC command finishing its work.
void ReleaseSessionsForFabricExceptOne(FabricIndex fabricIndex, const SessionHandle & deferred);

/**
* @brief
Expand Down

0 comments on commit 3c7158f

Please sign in to comment.