merged uTP fix from RC_0_16
This commit is contained in:
@@ -3291,7 +3291,7 @@ namespace libtorrent
|
||||
// a connection attempt using uTP just failed
|
||||
// mark this peer as not supporting uTP
|
||||
// we'll never try it again (unless we're trying holepunch)
|
||||
if (m_socket->get<utp_stream>()
|
||||
if (is_utp(*m_socket)
|
||||
&& m_peer_info
|
||||
&& m_peer_info->supports_utp
|
||||
&& !m_holepunch_mode)
|
||||
@@ -3310,7 +3310,8 @@ namespace libtorrent
|
||||
fast_reconnect(true);
|
||||
|
||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||
if ((!m_socket->get<utp_stream>() || !m_ses.m_settings.enable_outgoing_tcp)
|
||||
if ((!is_utp(*m_socket)
|
||||
|| !m_ses.m_settings.enable_outgoing_tcp)
|
||||
&& m_peer_info
|
||||
&& m_peer_info->supports_holepunch
|
||||
&& !m_holepunch_mode)
|
||||
@@ -3400,7 +3401,7 @@ namespace libtorrent
|
||||
if (ec == error_code(errors::timed_out_no_handshake))
|
||||
++m_ses.m_connect_timeouts;
|
||||
|
||||
if (m_socket->get<utp_stream>()) ++m_ses.m_error_utp_peers;
|
||||
if (is_utp(*m_socket)) ++m_ses.m_error_utp_peers;
|
||||
else ++m_ses.m_error_tcp_peers;
|
||||
|
||||
if (m_outgoing) ++m_ses.m_error_outgoing_peers;
|
||||
@@ -5384,11 +5385,7 @@ namespace libtorrent
|
||||
if (m_disconnecting) return;
|
||||
m_last_receive = time_now();
|
||||
|
||||
if ((m_socket->get<utp_stream>()
|
||||
#ifdef TORRENT_USE_OPENSSL
|
||||
|| m_socket->get<ssl_stream<utp_stream> >()
|
||||
#endif
|
||||
) && m_peer_info)
|
||||
if (is_utp(*m_socket) && m_peer_info)
|
||||
{
|
||||
m_peer_info->confirmed_supports_utp = true;
|
||||
m_peer_info->supports_utp = false;
|
||||
|
Reference in New Issue
Block a user