updated asserts

This commit is contained in:
Arvid Norberg 2007-07-04 16:15:46 +00:00
parent b20270d243
commit 3c69e3b2cb
2 changed files with 4 additions and 2 deletions

View File

@ -1411,7 +1411,8 @@ namespace libtorrent
++total_connections;
if (!p.connection) continue;
if (!m_torrent->settings().allow_multiple_connections_per_ip)
assert(p.connection == m_torrent->connection_for(p.ip.address()));
assert(p.connection == m_torrent->connection_for(p.ip.address())
|| p.connection == m_torrent->connection_for(p.ip));
assert(p.connection->peer_info_struct() == 0
|| p.connection->peer_info_struct() == &p);
++nonempty_connections;

View File

@ -938,7 +938,8 @@ namespace libtorrent
if (p == 0) continue;
#ifndef NDEBUG
if (!settings().allow_multiple_connections_per_ip)
assert(p->connection == 0 || p->connection == connection_for(p->ip.address()));
assert(p->connection == 0 || p->connection == connection_for(p->ip.address())
|| p->connection == connection_for(p->ip));
#endif
if (p->connection) p->connection->received_invalid_data(index);