forked from premiere/premiere-libtorrent
added some comments
This commit is contained in:
parent
bf545fc508
commit
8f1f0334c3
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue