merged fixes from RC_0_16

This commit is contained in:
Arvid Norberg 2012-10-21 20:24:14 +00:00
parent f61b95f782
commit 16630f94d1
5 changed files with 22 additions and 4 deletions

View File

@ -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_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);

View File

@ -156,7 +156,8 @@ namespace libtorrent
continue;
}
TORRENT_TRY {
e.on_connect(-1);
if (e.connecting) e.on_timeout();
else e.on_connect(-1);
} TORRENT_CATCH(std::exception&) {}
tmp.pop_front();
}

View File

@ -989,7 +989,7 @@ namespace libtorrent
#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS
TORRENT_PIECE_PICKER_INVARIANT_CHECK;
#endif
TORRENT_ASSERT(bitmask.size() == m_piece_map.size());
TORRENT_ASSERT(bitmask.size() <= m_piece_map.size());
int index = 0;
bool updated = false;

View File

@ -4842,6 +4842,8 @@ namespace libtorrent
c->start();
if (c->is_disconnecting()) return;
m_ses.m_half_open.enqueue(
boost::bind(&peer_connection::on_connect, c, _1)
, boost::bind(&peer_connection::on_timeout, c)

View File

@ -856,16 +856,30 @@ void udp_socket::on_connect(int ticket)
+ m_outstanding_resolve
+ m_outstanding_connect_queue
+ m_outstanding_socks);
CHECK_MAGIC;
if (m_abort) return;
if (is_closed()) return;
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();
return;
}
if (m_abort) return;
if (is_closed()) return;
#if defined TORRENT_ASIO_DEBUGGING
add_outstanding_async("udp_socket::on_connected");
#endif