Skip to content

Commit

Permalink
[core] Restoring RTTVar from cached RTT after reconnection
Browse files Browse the repository at this point in the history
  • Loading branch information
mbakholdina authored and maxsharabayko committed Mar 15, 2021
1 parent 4b6dba2 commit 18e8889
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion srtcore/core.cpp
Expand Up @@ -871,7 +871,6 @@ void CUDT::open()
m_iRTT = 10 * COMM_SYN_INTERVAL_US;
m_iRTTVar = m_iRTT >> 1;


// set minimum NAK and EXP timeout to 300ms
m_tdMinNakInterval = milliseconds_from(300);
m_tdMinExpInterval = milliseconds_from(300);
Expand Down Expand Up @@ -4417,6 +4416,7 @@ EConnectStatus CUDT::postConnect(const CPacket &response, bool rendezvous, CUDTE
if (m_pCache->lookup(&ib) >= 0)
{
m_iRTT = ib.m_iRTT;
m_iRTTVar = m_iRTT >> 1;
m_iBandwidth = ib.m_iBandwidth;
}

Expand Down Expand Up @@ -5315,6 +5315,7 @@ void CUDT::acceptAndRespond(const sockaddr_any& agent, const sockaddr_any& peer,
if (m_pCache->lookup(&ib) >= 0)
{
m_iRTT = ib.m_iRTT;
m_iRTTVar = m_iRTT >> 1;
m_iBandwidth = ib.m_iBandwidth;
}

Expand Down

0 comments on commit 18e8889

Please sign in to comment.