asserts for unchoke slot handling

This commit is contained in:
Arvid Norberg 2008-10-14 02:03:54 +00:00
parent cb1fce0d62
commit fdadccf7a2
2 changed files with 2 additions and 0 deletions

View File

@ -280,6 +280,7 @@ namespace libtorrent
bool peer_connection::unchoke_compare(boost::intrusive_ptr<peer_connection const> const& p) const bool peer_connection::unchoke_compare(boost::intrusive_ptr<peer_connection const> const& p) const
{ {
TORRENT_ASSERT(p); TORRENT_ASSERT(p);
TORRENT_ASSERT(this != p);
peer_connection const& rhs = *p; peer_connection const& rhs = *p;
// first compare how many bytes they've sent us // first compare how many bytes they've sent us

View File

@ -1417,6 +1417,7 @@ namespace aux {
, end(m_connections.end()); i != end; ++i) , end(m_connections.end()); i != end; ++i)
{ {
peer_connection* p = i->get(); peer_connection* p = i->get();
TORRENT_ASSERT(p);
torrent* t = p->associated_torrent().lock().get(); torrent* t = p->associated_torrent().lock().get();
if (!p->peer_info_struct() if (!p->peer_info_struct()
|| t == 0 || t == 0