make uTP less aggressive resetting cwnd when idle
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
* make uTP less aggressive resetting cwnd when idle
|
||||||
|
|
||||||
0.16.1 release
|
0.16.1 release
|
||||||
|
|
||||||
* fixed crash when providing corrupt resume data
|
* fixed crash when providing corrupt resume data
|
||||||
|
@@ -2880,7 +2880,19 @@ void utp_socket_impl::tick(ptime const& now)
|
|||||||
// we can now sent messages again, the send window was opened
|
// we can now sent messages again, the send window was opened
|
||||||
if ((m_cwnd >> 16) < m_mtu) window_opened = true;
|
if ((m_cwnd >> 16) < m_mtu) window_opened = true;
|
||||||
|
|
||||||
|
if (m_bytes_in_flight == 0 && (m_cwnd >> 16) >= m_mtu)
|
||||||
|
{
|
||||||
|
// this is just a timeout because this direction of
|
||||||
|
// the stream is idle. Don't reset the cwnd, just decay it
|
||||||
|
m_cwnd = m_cwnd * 2 / 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// we timed out because a packet was not ACKed or because
|
||||||
|
// the cwnd was made smaller than one packet
|
||||||
m_cwnd = boost::int64_t(m_mtu) << 16;
|
m_cwnd = boost::int64_t(m_mtu) << 16;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_outbuf.size()) ++m_num_timeouts;
|
if (m_outbuf.size()) ++m_num_timeouts;
|
||||||
|
|
||||||
if (m_num_timeouts > m_sm->num_resends())
|
if (m_num_timeouts > m_sm->num_resends())
|
||||||
|
Reference in New Issue
Block a user