merged fixes from RC_0_16
This commit is contained in:
parent
f61b95f782
commit
16630f94d1
|
@ -58,6 +58,7 @@ int TORRENT_EXTRA_EXPORT distance_exp(node_id const& n1, node_id const& n2);
|
||||||
|
|
||||||
node_id TORRENT_EXTRA_EXPORT generate_id(address const& external_ip);
|
node_id TORRENT_EXTRA_EXPORT generate_id(address const& external_ip);
|
||||||
node_id TORRENT_EXTRA_EXPORT generate_random_id();
|
node_id TORRENT_EXTRA_EXPORT generate_random_id();
|
||||||
|
node_id TORRENT_EXTRA_EXPORT generate_id_impl(address const& ip_, boost::uint32_t r);
|
||||||
|
|
||||||
bool TORRENT_EXTRA_EXPORT verify_id(node_id const& nid, address const& source_ip);
|
bool TORRENT_EXTRA_EXPORT verify_id(node_id const& nid, address const& source_ip);
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,8 @@ namespace libtorrent
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
TORRENT_TRY {
|
TORRENT_TRY {
|
||||||
e.on_connect(-1);
|
if (e.connecting) e.on_timeout();
|
||||||
|
else e.on_connect(-1);
|
||||||
} TORRENT_CATCH(std::exception&) {}
|
} TORRENT_CATCH(std::exception&) {}
|
||||||
tmp.pop_front();
|
tmp.pop_front();
|
||||||
}
|
}
|
||||||
|
|
|
@ -989,7 +989,7 @@ namespace libtorrent
|
||||||
#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS
|
#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS
|
||||||
TORRENT_PIECE_PICKER_INVARIANT_CHECK;
|
TORRENT_PIECE_PICKER_INVARIANT_CHECK;
|
||||||
#endif
|
#endif
|
||||||
TORRENT_ASSERT(bitmask.size() == m_piece_map.size());
|
TORRENT_ASSERT(bitmask.size() <= m_piece_map.size());
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
|
|
|
@ -4842,6 +4842,8 @@ namespace libtorrent
|
||||||
|
|
||||||
c->start();
|
c->start();
|
||||||
|
|
||||||
|
if (c->is_disconnecting()) return;
|
||||||
|
|
||||||
m_ses.m_half_open.enqueue(
|
m_ses.m_half_open.enqueue(
|
||||||
boost::bind(&peer_connection::on_connect, c, _1)
|
boost::bind(&peer_connection::on_connect, c, _1)
|
||||||
, boost::bind(&peer_connection::on_timeout, c)
|
, boost::bind(&peer_connection::on_timeout, c)
|
||||||
|
|
|
@ -856,16 +856,30 @@ void udp_socket::on_connect(int ticket)
|
||||||
+ m_outstanding_resolve
|
+ m_outstanding_resolve
|
||||||
+ m_outstanding_connect_queue
|
+ m_outstanding_connect_queue
|
||||||
+ m_outstanding_socks);
|
+ m_outstanding_socks);
|
||||||
|
|
||||||
CHECK_MAGIC;
|
CHECK_MAGIC;
|
||||||
|
|
||||||
if (m_abort) return;
|
|
||||||
if (is_closed()) return;
|
|
||||||
if (ticket == -1)
|
if (ticket == -1)
|
||||||
{
|
{
|
||||||
|
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
|
||||||
|
TORRENT_ASSERT(m_outstanding_timeout > 0);
|
||||||
|
--m_outstanding_timeout;
|
||||||
|
#endif
|
||||||
|
TORRENT_ASSERT(m_outstanding_ops > 0);
|
||||||
|
--m_outstanding_ops;
|
||||||
|
TORRENT_ASSERT(m_outstanding_ops == m_outstanding_connect
|
||||||
|
+ m_outstanding_timeout
|
||||||
|
+ m_outstanding_resolve
|
||||||
|
+ m_outstanding_connect_queue
|
||||||
|
+ m_outstanding_socks);
|
||||||
close();
|
close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (m_abort) return;
|
||||||
|
if (is_closed()) return;
|
||||||
|
|
||||||
#if defined TORRENT_ASIO_DEBUGGING
|
#if defined TORRENT_ASIO_DEBUGGING
|
||||||
add_outstanding_async("udp_socket::on_connected");
|
add_outstanding_async("udp_socket::on_connected");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue