mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
delete strem from destination upon termination
This commit is contained in:
parent
1e9a53da3f
commit
5eec580727
@ -86,13 +86,14 @@ namespace stream
|
|||||||
LogPrint (eLogDebug, "Streaming: Stream deleted");
|
LogPrint (eLogDebug, "Streaming: Stream deleted");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stream::Terminate () // shoudl be called from StreamingDestination::Stop only
|
void Stream::Terminate (bool deleteFromDestination) // shoudl be called from StreamingDestination::Stop only
|
||||||
{
|
{
|
||||||
m_AckSendTimer.cancel ();
|
m_AckSendTimer.cancel ();
|
||||||
m_ReceiveTimer.cancel ();
|
m_ReceiveTimer.cancel ();
|
||||||
m_ResendTimer.cancel ();
|
m_ResendTimer.cancel ();
|
||||||
//CleanUp (); /* Need to recheck - broke working on windows */
|
//CleanUp (); /* Need to recheck - broke working on windows */
|
||||||
//m_LocalDestination.DeleteStream (shared_from_this ());
|
if (deleteFromDestination)
|
||||||
|
m_LocalDestination.DeleteStream (shared_from_this ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stream::CleanUp ()
|
void Stream::CleanUp ()
|
||||||
@ -993,7 +994,7 @@ namespace stream
|
|||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_StreamsMutex);
|
std::unique_lock<std::mutex> l(m_StreamsMutex);
|
||||||
for (auto it: m_Streams)
|
for (auto it: m_Streams)
|
||||||
it.second->Terminate ();
|
it.second->Terminate (false); // we delete here
|
||||||
m_Streams.clear ();
|
m_Streams.clear ();
|
||||||
m_IncomingStreams.clear ();
|
m_IncomingStreams.clear ();
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ namespace stream
|
|||||||
int GetWindowSize () const { return m_WindowSize; };
|
int GetWindowSize () const { return m_WindowSize; };
|
||||||
int GetRTT () const { return m_RTT; };
|
int GetRTT () const { return m_RTT; };
|
||||||
|
|
||||||
void Terminate ();
|
void Terminate (bool deleteFromDestination = true);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user