MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / HandleSessionCleanupTimer

Method HandleSessionCleanupTimer

libi2pd_client/SAM.cpp:1599–1622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1597 }
1598
1599 void SAMBridge::HandleSessionCleanupTimer (const boost::system::error_code& ecode,
1600 std::shared_ptr<SAMSession> session, std::shared_ptr<boost::asio::steady_timer> timer)
1601 {
1602 if (ecode != boost::asio::error::operation_aborted && session)
1603 {
1604 auto dest = session->GetLocalDestination ();
1605 if (dest)
1606 {
1607 auto streamingDest = dest->GetStreamingDestination ();
1608 if (streamingDest)
1609 {
1610 auto numStreams = streamingDest->GetNumStreams ();
1611 if (numStreams > 0)
1612 {
1613 LogPrint (eLogInfo, "SAM: Session ", session->Name, " still has ", numStreams, " streams");
1614 ScheduleSessionCleanupTimer (session);
1615 }
1616 else
1617 LogPrint (eLogDebug, "SAM: Session ", session->Name, " terminated");
1618 }
1619 }
1620 }
1621 // session's destructor is called here unless rescheduled
1622 }
1623
1624 std::shared_ptr<SAMSession> SAMBridge::FindSession (std::string_view id) const
1625 {

Callers

nothing calls this directly

Calls 4

LogPrintFunction · 0.85
GetNumStreamsMethod · 0.80
GetLocalDestinationMethod · 0.45

Tested by

no test coverage detected