uTP timeout fix. introduced when fixing the recent vulnerability

This commit is contained in:
arvidn 2015-08-12 23:05:33 -04:00
parent d2819cd1b9
commit 213958f98d
1 changed files with 2 additions and 1 deletions

View File

@ -3526,7 +3526,8 @@ void utp_socket_impl::tick(time_point now)
// a socket that has not been confirmed to actually have a live remote end
// (the IP may have been spoofed) fail on the first timeout. If we had
// heard anything from this peer, it would have been confirmed.
if (m_num_timeouts > m_sm->num_resends() || !m_confirmed)
if (m_num_timeouts > m_sm->num_resends()
|| (m_num_timeouts > 0 && !m_confirmed))
{
// the connection is dead
m_error = boost::asio::error::timed_out;