modified some assertions in policy
This commit is contained in:
parent
da6afef0ae
commit
cbcf8df504
|
@ -1289,7 +1289,7 @@ namespace libtorrent
|
|||
// so in the destructor of new_connection this
|
||||
// case will be used.
|
||||
assert(connected_peers == num_torrent_peers
|
||||
|| connected_peers - 1 == num_torrent_peers);
|
||||
|| connected_peers == num_torrent_peers - 1);
|
||||
|
||||
// TODO: Make sure the number of peers in m_torrent is equal
|
||||
// to the number of connected peers in m_peers.
|
||||
|
|
|
@ -853,6 +853,9 @@ namespace libtorrent
|
|||
|
||||
m_policy->connection_closed(*p);
|
||||
m_connections.erase(i);
|
||||
#ifndef NDEBUG
|
||||
m_policy->check_invariant();
|
||||
#endif
|
||||
}
|
||||
|
||||
peer_connection& torrent::connect_to_peer(const address& a)
|
||||
|
@ -868,12 +871,20 @@ namespace libtorrent
|
|||
// add the newly connected peer to this torrent's peer list
|
||||
assert(m_connections.find(p->second->get_socket()->sender())
|
||||
== m_connections.end());
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
m_policy->check_invariant();
|
||||
#endif
|
||||
|
||||
m_connections.insert(
|
||||
std::make_pair(
|
||||
p->second->get_socket()->sender()
|
||||
, boost::get_pointer(p->second)));
|
||||
|
||||
#ifndef NDEBUG
|
||||
m_policy->check_invariant();
|
||||
#endif
|
||||
|
||||
m_ses.m_selector.monitor_readability(s);
|
||||
m_ses.m_selector.monitor_errors(s);
|
||||
return *c;
|
||||
|
@ -889,9 +900,13 @@ namespace libtorrent
|
|||
= m_ses.m_connections.find(p->get_socket());
|
||||
assert(i != m_ses.m_connections.end());
|
||||
|
||||
m_policy->new_connection(*i->second);
|
||||
#ifndef NDEBUG
|
||||
m_policy->check_invariant();
|
||||
#endif
|
||||
|
||||
m_connections.insert(std::make_pair(p->get_socket()->sender(), p));
|
||||
|
||||
m_policy->new_connection(*i->second);
|
||||
}
|
||||
|
||||
void torrent::disconnect_all()
|
||||
|
|
Loading…
Reference in New Issue