extend plugin API to allow hooking when peers are added to the peer list

This commit is contained in:
Arvid Norberg
2011-05-02 01:45:56 +00:00
parent ddb70f3f68
commit c003e4f810
5 changed files with 95 additions and 0 deletions

View File

@@ -7375,6 +7375,20 @@ namespace libtorrent
#endif
}
#ifndef TORRENT_DISABLE_EXTENSIONS
void torrent::notify_extension_add_peer(tcp::endpoint const& ip
, int src, int flags)
{
for (extension_list_t::iterator i = m_extensions.begin()
, end(m_extensions.end()); i != end; ++i)
{
TORRENT_TRY {
(*i)->on_add_peer(ip, src, flags);
} TORRENT_CATCH (std::exception&) {}
}
}
#endif
void torrent::status(torrent_status* st, boost::uint32_t flags)
{
INVARIANT_CHECK;