more debug messages at destinations stop

Signed-off-by: r4sas <r4sas@i2pmail.org>
pull/1928/merge
r4sas 1 year ago
parent a2726cf206
commit fdf38f45d9
No known key found for this signature in database
GPG Key ID: 66F6C87B98EBCFE2

@ -1036,11 +1036,15 @@ namespace client
void ClientDestination::Stop () void ClientDestination::Stop ()
{ {
LogPrint(eLogDebug, "Destination: Stopping destination ", GetIdentHash().ToBase32(), ".b32.i2p");
LeaseSetDestination::Stop (); LeaseSetDestination::Stop ();
m_ReadyChecker.cancel(); m_ReadyChecker.cancel();
LogPrint(eLogDebug, "Destination: -> Stopping Streaming Destination");
m_StreamingDestination->Stop (); m_StreamingDestination->Stop ();
//m_StreamingDestination->SetOwner (nullptr); //m_StreamingDestination->SetOwner (nullptr);
m_StreamingDestination = nullptr; m_StreamingDestination = nullptr;
LogPrint(eLogDebug, "Destination: -> Stopping Streaming Destination by ports");
for (auto& it: m_StreamingDestinationsByPorts) for (auto& it: m_StreamingDestinationsByPorts)
{ {
it.second->Stop (); it.second->Stop ();
@ -1048,11 +1052,14 @@ namespace client
} }
m_StreamingDestinationsByPorts.clear (); m_StreamingDestinationsByPorts.clear ();
m_LastStreamingDestination = nullptr; m_LastStreamingDestination = nullptr;
if (m_DatagramDestination) if (m_DatagramDestination)
{ {
LogPrint(eLogDebug, "Destination: -> Stopping Datagram Destination");
delete m_DatagramDestination; delete m_DatagramDestination;
m_DatagramDestination = nullptr; m_DatagramDestination = nullptr;
} }
LogPrint(eLogDebug, "Destination: -> Stopping done");
} }
void ClientDestination::HandleDataMessage (const uint8_t * buf, size_t len) void ClientDestination::HandleDataMessage (const uint8_t * buf, size_t len)
@ -1075,10 +1082,10 @@ namespace client
if (toPort != m_LastPort || !m_LastStreamingDestination) if (toPort != m_LastPort || !m_LastStreamingDestination)
{ {
m_LastStreamingDestination = GetStreamingDestination (toPort); m_LastStreamingDestination = GetStreamingDestination (toPort);
if (!m_LastStreamingDestination) if (!m_LastStreamingDestination)
m_LastStreamingDestination = m_StreamingDestination; // if no destination on port use default m_LastStreamingDestination = m_StreamingDestination; // if no destination on port use default
m_LastPort = toPort; m_LastPort = toPort;
} }
if (m_LastStreamingDestination) if (m_LastStreamingDestination)
m_LastStreamingDestination->HandleDataMessagePayload (buf, length); m_LastStreamingDestination->HandleDataMessagePayload (buf, length);
else else

@ -186,22 +186,30 @@ namespace client
LogPrint(eLogInfo, "Clients: Stopping AddressBook"); LogPrint(eLogInfo, "Clients: Stopping AddressBook");
m_AddressBook.Stop (); m_AddressBook.Stop ();
LogPrint(eLogInfo, "Clients: Stopping UDP Tunnels");
{ {
std::lock_guard<std::mutex> lock(m_ForwardsMutex); std::lock_guard<std::mutex> lock(m_ForwardsMutex);
m_ServerForwards.clear(); m_ServerForwards.clear();
m_ClientForwards.clear(); m_ClientForwards.clear();
} }
LogPrint(eLogInfo, "Clients: Stopping UDP Tunnels timers");
if (m_CleanupUDPTimer) if (m_CleanupUDPTimer)
{ {
m_CleanupUDPTimer->cancel (); m_CleanupUDPTimer->cancel ();
m_CleanupUDPTimer = nullptr; m_CleanupUDPTimer = nullptr;
} }
for (auto& it: m_Destinations) {
it.second->Stop (); LogPrint(eLogInfo, "Clients: Stopping Destinations");
m_Destinations.clear (); std::lock_guard<std::mutex> lock(m_DestinationsMutex);
for (auto& it: m_Destinations)
it.second->Stop ();
LogPrint(eLogInfo, "Clients: Stopping Destinations - Clear");
m_Destinations.clear ();
}
LogPrint(eLogInfo, "Clients: Stopping SharedLocalDestination");
m_SharedLocalDestination->Release (); m_SharedLocalDestination->Release ();
m_SharedLocalDestination = nullptr; m_SharedLocalDestination = nullptr;
} }

Loading…
Cancel
Save