Skip to content

Commit

Permalink
Update log messages for session expiry (project-chip#8017)
Browse files Browse the repository at this point in the history
* Update log messages for session expiry

* update format specifier
  • Loading branch information
pan-apple authored Jul 1, 2021
1 parent 8551b50 commit 8631052
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/transport/SecureSessionMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ CHIP_ERROR SecureSessionMgr::NewPairing(const Optional<Transport::PeerAddress> &
state, [this](const Transport::PeerConnectionState & state1) { HandleConnectionExpired(state1); });
}

ChipLogDetail(Inet, "New pairing for device 0x%08" PRIx32 "%08" PRIx32 ", key %d!!", static_cast<uint32_t>(peerNodeId >> 32),
static_cast<uint32_t>(peerNodeId), peerKeyId);
ChipLogDetail(Inet, "New secure session created for device 0x" ChipLogFormatX64 ", key %d!!", ChipLogValueX64(peerNodeId),
peerKeyId);
state = nullptr;
ReturnErrorOnFailure(
mPeerConnections.CreateNewPeerConnectionState(Optional<NodeId>::Value(peerNodeId), peerKeyId, localKeyId, &state));
Expand Down Expand Up @@ -519,10 +519,8 @@ void SecureSessionMgr::SecureMessageDispatch(const PacketHeader & packetHeader,

void SecureSessionMgr::HandleConnectionExpired(const Transport::PeerConnectionState & state)
{
char addr[Transport::PeerAddress::kMaxToStringSize];
state.GetPeerAddress().ToString(addr);

ChipLogDetail(Inet, "Connection from '%s' expired", addr);
NodeId peerNodeId = state.GetPeerNodeId();
ChipLogDetail(Inet, "Marking old secure session for device 0x" ChipLogFormatX64 " as expired", ChipLogValueX64(peerNodeId));

if (mCB != nullptr)
{
Expand Down

0 comments on commit 8631052

Please sign in to comment.