uTP timeout fix

This commit is contained in:
Arvid Norberg 2012-05-05 23:54:41 +00:00
parent 7f2f705b49
commit 0d7e3cb8c7
1 changed files with 10 additions and 0 deletions

View File

@ -2882,6 +2882,16 @@ void utp_socket_impl::tick(ptime const& now)
m_cwnd = boost::int64_t(m_mtu) << 16;
if (m_outbuf.size()) ++m_num_timeouts;
if (m_num_timeouts > m_sm->num_resends())
{
// the connection is dead
m_error = asio::error::timed_out;
m_state = UTP_STATE_ERROR_WAIT;
test_socket_state();
return;
}
m_timeout = now + milliseconds(packet_timeout());
UTP_LOGV("%8p: timeout resetting cwnd:%d\n"