From 17641de17a19df9401fbf070bbb0ad1dd3a0a92a Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Tue, 1 Jul 2014 07:59:47 -0300 Subject: [PATCH] Revert commit in order to apply the upstream fix. Revert "don't rely on m_connection_ticket: if we have two "on_connect" in a row," This reverts commit 241291be70908394deff90758b90e86d32ab0004. --- libtorrent/include/libtorrent/udp_socket.hpp | 2 +- libtorrent/src/udp_socket.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libtorrent/include/libtorrent/udp_socket.hpp b/libtorrent/include/libtorrent/udp_socket.hpp index e9cb2e86..d25d46ca 100644 --- a/libtorrent/include/libtorrent/udp_socket.hpp +++ b/libtorrent/include/libtorrent/udp_socket.hpp @@ -176,7 +176,7 @@ namespace libtorrent void on_name_lookup(error_code const& e, tcp::resolver::iterator i); void on_timeout(); void on_connect(int ticket); - void on_connected(error_code const& ec, int ticket); + void on_connected(error_code const& ec); void handshake1(error_code const& e); void handshake2(error_code const& e); void handshake3(error_code const& e); diff --git a/libtorrent/src/udp_socket.cpp b/libtorrent/src/udp_socket.cpp index 7701ac21..e5445350 100644 --- a/libtorrent/src/udp_socket.cpp +++ b/libtorrent/src/udp_socket.cpp @@ -885,10 +885,10 @@ void udp_socket::on_connect(int ticket) ++m_outstanding_connect; #endif m_socks5_sock.async_connect(tcp::endpoint(m_proxy_addr.address(), m_proxy_addr.port()) - , boost::bind(&udp_socket::on_connected, this, _1, ticket)); + , boost::bind(&udp_socket::on_connected, this, _1)); } -void udp_socket::on_connected(error_code const& e, int ticket) +void udp_socket::on_connected(error_code const& e) { #if defined TORRENT_ASIO_DEBUGGING complete_async("udp_socket::on_connected"); @@ -910,7 +910,7 @@ void udp_socket::on_connected(error_code const& e, int ticket) if (e == asio::error::operation_aborted) return; TORRENT_ASSERT(is_single_thread()); - m_cc.done(ticket); + m_cc.done(m_connection_ticket); m_connection_ticket = -1; // we just called done, which means on_timeout