mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-08 22:13:48 +01:00
correct termination of streaming destination
This commit is contained in:
parent
09ed57ad42
commit
32e2f0b1fa
2 changed files with 4 additions and 3 deletions
|
@ -86,13 +86,13 @@ namespace stream
|
||||||
LogPrint (eLogDebug, "Streaming: Stream deleted");
|
LogPrint (eLogDebug, "Streaming: Stream deleted");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stream::Terminate ()
|
void Stream::Terminate () // 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 ());
|
//m_LocalDestination.DeleteStream (shared_from_this ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stream::CleanUp ()
|
void Stream::CleanUp ()
|
||||||
|
@ -989,6 +989,8 @@ namespace stream
|
||||||
m_PendingIncomingStreams.clear ();
|
m_PendingIncomingStreams.clear ();
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_StreamsMutex);
|
std::unique_lock<std::mutex> l(m_StreamsMutex);
|
||||||
|
for (auto it: m_Streams)
|
||||||
|
it.second->Terminate ();
|
||||||
m_Streams.clear ();
|
m_Streams.clear ();
|
||||||
m_IncomingStreams.clear ();
|
m_IncomingStreams.clear ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,7 +180,6 @@ 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; };
|
||||||
|
|
||||||
/** don't call me */
|
|
||||||
void Terminate ();
|
void Terminate ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Reference in a new issue