Browse Source

don't reschedule resend timer for terminated streams

pull/1687/head
orignal 3 years ago
parent
commit
49b3ac7f77
  1. 4
      libi2pd/Streaming.cpp
  2. 3
      libi2pd/Streaming.h

4
libi2pd/Streaming.cpp

@ -104,6 +104,7 @@ namespace stream
void Stream::Terminate (bool deleteFromDestination) // shoudl be called from StreamingDestination::Stop only void Stream::Terminate (bool deleteFromDestination) // shoudl be called from StreamingDestination::Stop only
{ {
m_Status = eStreamStatusTerminated;
m_AckSendTimer.cancel (); m_AckSendTimer.cancel ();
m_ReceiveTimer.cancel (); m_ReceiveTimer.cancel ();
m_ResendTimer.cancel (); m_ResendTimer.cancel ();
@ -856,6 +857,8 @@ namespace stream
} }
void Stream::ScheduleResend () void Stream::ScheduleResend ()
{
if (m_Status != eStreamStatusTerminated)
{ {
m_ResendTimer.cancel (); m_ResendTimer.cancel ();
// check for invalid value // check for invalid value
@ -864,6 +867,7 @@ namespace stream
m_ResendTimer.async_wait (std::bind (&Stream::HandleResendTimer, m_ResendTimer.async_wait (std::bind (&Stream::HandleResendTimer,
shared_from_this (), std::placeholders::_1)); shared_from_this (), std::placeholders::_1));
} }
}
void Stream::HandleResendTimer (const boost::system::error_code& ecode) void Stream::HandleResendTimer (const boost::system::error_code& ecode)
{ {

3
libi2pd/Streaming.h

@ -152,7 +152,8 @@ namespace stream
eStreamStatusOpen, eStreamStatusOpen,
eStreamStatusReset, eStreamStatusReset,
eStreamStatusClosing, eStreamStatusClosing,
eStreamStatusClosed eStreamStatusClosed,
eStreamStatusTerminated
}; };
class StreamingDestination; class StreamingDestination;

Loading…
Cancel
Save