removed unneccesary connection lookup in connect_peer
This commit is contained in:
parent
c871167ec3
commit
983f4bc02e
|
@ -1888,6 +1888,10 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
|
||||||
|
assert(peerinfo);
|
||||||
|
assert(peerinfo->connection == 0);
|
||||||
|
assert(m_connections.find(peerinfo->ip) == m_connections.end());
|
||||||
|
|
||||||
if (!want_more_peers()) return 0;
|
if (!want_more_peers()) return 0;
|
||||||
|
|
||||||
tcp::endpoint const& a(peerinfo->ip);
|
tcp::endpoint const& a(peerinfo->ip);
|
||||||
|
@ -1901,8 +1905,6 @@ namespace libtorrent
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_connections.find(a) != m_connections.end()) return 0;
|
|
||||||
|
|
||||||
boost::shared_ptr<socket_type> s
|
boost::shared_ptr<socket_type> s
|
||||||
= instantiate_connection(m_ses.m_io_service, m_ses.peer_proxy());
|
= instantiate_connection(m_ses.m_io_service, m_ses.peer_proxy());
|
||||||
boost::intrusive_ptr<peer_connection> c(new bt_peer_connection(
|
boost::intrusive_ptr<peer_connection> c(new bt_peer_connection(
|
||||||
|
@ -1925,8 +1927,6 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
m_ses.m_connection_queue.push_back(c);
|
m_ses.m_connection_queue.push_back(c);
|
||||||
|
|
||||||
assert(m_connections.find(a) == m_connections.end());
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
m_policy->check_invariant();
|
m_policy->check_invariant();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue