added another assert in policy

This commit is contained in:
Arvid Norberg 2005-09-28 18:32:05 +00:00
parent daf7314476
commit 7a4750d540
2 changed files with 7 additions and 1 deletions

View File

@ -37,6 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#endif #endif
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/bind.hpp>
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
@ -55,6 +56,7 @@ namespace libtorrent
} }
using namespace boost::posix_time; using namespace boost::posix_time;
using boost::bind;
namespace namespace
{ {
@ -1048,6 +1050,10 @@ namespace libtorrent
{ {
INVARIANT_CHECK; INVARIANT_CHECK;
assert(std::find_if(m_peers.begin(), m_peers.end()
, bind(std::equal_to<peer_connection*>(), bind(&peer::connection, _1)
, &c)) != m_peers.end());
// if the peer is choked and we have upload slots left, // if the peer is choked and we have upload slots left,
// then unchoke it. Another condition that has to be met // then unchoke it. Another condition that has to be met
// is that the torrent doesn't keep track of the individual // is that the torrent doesn't keep track of the individual

View File

@ -305,7 +305,7 @@ namespace libtorrent
try try
{ {
m_creation_date = ptime(date(1970, Jan, 1)) m_creation_date = ptime(date(1970, Jan, 1))
+ seconds(torrent_file["creation date"].integer()); + seconds(long(torrent_file["creation date"].integer()));
} }
catch (type_error) {} catch (type_error) {}