don't reschedule resend timer for terminated streams

This commit is contained in:
orignal 2021-08-11 12:23:43 -04:00
parent d124d4cace
commit 49b3ac7f77
2 changed files with 12 additions and 7 deletions

View file

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

View file

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