added some comments

This commit is contained in:
Arvid Norberg 2009-07-27 23:34:50 +00:00
parent bf545fc508
commit 8f1f0334c3
2 changed files with 7 additions and 0 deletions

View File

@ -817,6 +817,9 @@ namespace libtorrent
return true;
}
// it's important that we don't dereference
// p here, since it is allowed to be a dangling
// pointer. see smart_ban.cpp
bool policy::has_peer(policy::peer const* p) const
{
// find p in m_peers

View File

@ -196,6 +196,10 @@ namespace libtorrent { namespace
// from the first time it sent it
// at least one of them must be bad
// verify that this is not a dangling pointer
// if the pointer is in the policy's list, it
// still live, if it's not, it has been removed
// and we can't use this pointer
if (!m_torrent.get_policy().has_peer(p)) return;
#ifdef TORRENT_LOGGING