From 7a4750d540ac0211f7aab8b9bdb1a0917de4c199 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 28 Sep 2005 18:32:05 +0000 Subject: [PATCH] added another assert in policy --- src/policy.cpp | 6 ++++++ src/torrent_info.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/policy.cpp b/src/policy.cpp index e4409979c..bb3f6a0d7 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -37,6 +37,7 @@ POSSIBILITY OF SUCH DAMAGE. #endif #include +#include #ifdef _MSC_VER #pragma warning(pop) @@ -55,6 +56,7 @@ namespace libtorrent } using namespace boost::posix_time; +using boost::bind; namespace { @@ -1048,6 +1050,10 @@ namespace libtorrent { INVARIANT_CHECK; + assert(std::find_if(m_peers.begin(), m_peers.end() + , bind(std::equal_to(), bind(&peer::connection, _1) + , &c)) != m_peers.end()); + // if the peer is choked and we have upload slots left, // then unchoke it. Another condition that has to be met // is that the torrent doesn't keep track of the individual diff --git a/src/torrent_info.cpp b/src/torrent_info.cpp index 8970abb2c..55da94dc7 100755 --- a/src/torrent_info.cpp +++ b/src/torrent_info.cpp @@ -305,7 +305,7 @@ namespace libtorrent try { m_creation_date = ptime(date(1970, Jan, 1)) - + seconds(torrent_file["creation date"].integer()); + + seconds(long(torrent_file["creation date"].integer())); } catch (type_error) {}