From 213958f98de374d49a718547e5981173011623f2 Mon Sep 17 00:00:00 2001 From: arvidn Date: Wed, 12 Aug 2015 23:05:33 -0400 Subject: [PATCH] uTP timeout fix. introduced when fixing the recent vulnerability --- src/utp_stream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utp_stream.cpp b/src/utp_stream.cpp index da8ebae5d..fcc4aea4f 100644 --- a/src/utp_stream.cpp +++ b/src/utp_stream.cpp @@ -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;