close stream if SYACK is not acked

This commit is contained in:
orignal 2024-11-17 20:51:59 -05:00
parent 3c4926f377
commit 5b2d0c579b

View file

@ -1338,6 +1338,13 @@ namespace stream
void Stream::ResendPacket () void Stream::ResendPacket ()
{ {
// check for resend attempts // check for resend attempts
if (m_SequenceNumber == 1 && m_NumResendAttempts > 0)
{
LogPrint (eLogWarning, "Streaming: SYNACK packet was not ACKed after ", m_NumResendAttempts, " attempts, terminate, rSID=", m_RecvStreamID, ", sSID=", m_SendStreamID);
m_Status = eStreamStatusReset;
Close ();
return;
}
if (m_NumResendAttempts >= MAX_NUM_RESEND_ATTEMPTS) if (m_NumResendAttempts >= MAX_NUM_RESEND_ATTEMPTS)
{ {
LogPrint (eLogWarning, "Streaming: packet was not ACKed after ", MAX_NUM_RESEND_ATTEMPTS, " attempts, terminate, rSID=", m_RecvStreamID, ", sSID=", m_SendStreamID); LogPrint (eLogWarning, "Streaming: packet was not ACKed after ", MAX_NUM_RESEND_ATTEMPTS, " attempts, terminate, rSID=", m_RecvStreamID, ", sSID=", m_SendStreamID);
@ -1424,13 +1431,7 @@ namespace stream
SendPackets (packets); SendPackets (packets);
m_LastSendTime = ts; m_LastSendTime = ts;
m_IsSendTime = false; m_IsSendTime = false;
if (m_IsNAcked || m_IsResendNeeded) if (m_IsNAcked || m_IsResendNeeded) ScheduleSend ();
{
if (m_SequenceNumber > 1) // doesn't resend agressively very first packet
ScheduleSend ();
else
ScheduleResend ();
}
} }
else else
SendBuffer (); SendBuffer ();