Skip to content

Commit

Permalink
Resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kghost committed May 5, 2022
1 parent 052193a commit 8b74520
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/protocols/secure_channel/PairingSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void PairingSession::Finish()
{
Transport::PeerAddress address = mExchangeCtxt->GetSessionHandle()->AsUnauthenticatedSession()->GetPeerAddress();

// Discard the exchange so that Clear() doesn't try closing it. The exchange will handle that.
// Discard the exchange so that our subclasses don't try closing it. The exchange will handle that.
DiscardExchange();

CHIP_ERROR err = ActivateSecureSession(address);
Expand Down Expand Up @@ -104,7 +104,7 @@ void PairingSession::DiscardExchange()
// Make sure the exchange doesn't try to notify us when it closes,
// since we might be dead by then.
mExchangeCtxt->SetDelegate(nullptr);
// Null out mExchangeCtxt so that Clear() doesn't try closing it. The
// Null out mExchangeCtxt so that our subclasses don't try closing it. The
// exchange will handle that.
mExchangeCtxt = nullptr;
}
Expand Down
6 changes: 3 additions & 3 deletions src/protocols/secure_channel/PairingSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ class DLL_EXPORT PairingSession

void Finish();

void AbortExchange();
void CloseExchange();
void DiscardExchange();
void AbortExchange(); // Called when error happens, terminate the pairing.
void CloseExchange(); // Called inside `Clear` to guarentee that the exchange is not leaked.
void DiscardExchange(); // Clear our reference to our exchange context pointer so that it can close itself at some later time.

void SetPeerSessionId(uint16_t id) { mPeerSessionId.SetValue(id); }
virtual void OnSuccessStatusReport() {}
Expand Down

0 comments on commit 8b74520

Please sign in to comment.