From 3c69e3b2cb6f8822f9bd200363cff7a0721b6641 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 4 Jul 2007 16:15:46 +0000 Subject: [PATCH] updated asserts --- src/policy.cpp | 3 ++- src/torrent.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/policy.cpp b/src/policy.cpp index 773817b3f..917694721 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -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; diff --git a/src/torrent.cpp b/src/torrent.cpp index 251c778cd..788c45c57 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -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);