Skip to content

Commit

Permalink
Some extra asserts.
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Aug 28, 2024
1 parent d9212ef commit 1f9b21f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gateway/app/gateway/GatewaySession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,10 @@ bool GatewaySession::startSession()
m_session->setFwdEncSessionCreatedReportCb(
[this](cc_mqttsn_gateway::Session* fwdEncSession) -> bool
{
assert(fwdEncSession != nullptr);
m_fwdEncSessions.push_back(std::make_unique<GatewaySession>(m_io, m_logger, m_config, fwdEncSession));
auto& sessionPtr = m_fwdEncSessions.back();
assert(sessionPtr->m_session == fwdEncSession);
sessionPtr->setTermReqCb(
[this, fwdSessionPtr = sessionPtr.get()]()
{
Expand Down Expand Up @@ -331,6 +333,7 @@ bool GatewaySession::startSession()
m_session->setFwdEncSessionDeletedReportCb(
[this](cc_mqttsn_gateway::Session* fwdEncSession)
{
assert(fwdEncSession != nullptr);
boost::asio::post(
m_io,
[this, fwdEncSession]()
Expand All @@ -340,6 +343,8 @@ bool GatewaySession::startSession()
m_fwdEncSessions.begin(), m_fwdEncSessions.end(),
[fwdEncSession](auto& sPtr)
{
assert(sPtr);
assert(sPtr->m_session != nullptr);
return sPtr->m_session == fwdEncSession;
});

Expand Down

0 comments on commit 1f9b21f

Please sign in to comment.