From 513d388c2c433d5a448a141c82f1dbaed615b88b Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 28 Mar 2007 22:59:35 +0000 Subject: [PATCH] added extension hook when files have been checked --- include/libtorrent/extensions.hpp | 4 ++++ src/torrent.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/include/libtorrent/extensions.hpp b/include/libtorrent/extensions.hpp index 9068aa62a..8514774b4 100644 --- a/include/libtorrent/extensions.hpp +++ b/include/libtorrent/extensions.hpp @@ -77,6 +77,10 @@ namespace libtorrent // default behavior will be skipped virtual bool on_pause() { return false; } virtual bool on_resume() { return false;} + + // this is called when the initial checking of + // files is completed. + virtual void on_files_checked() {} }; struct TORRENT_EXPORT peer_plugin diff --git a/src/torrent.cpp b/src/torrent.cpp index b358aa22b..2a241c95f 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -2299,6 +2299,14 @@ namespace libtorrent #ifndef NDEBUG m_initial_done = boost::get<0>(bytes_done()); #endif + +#ifndef TORRENT_DISABLE_EXTENSIONS + for (extension_list_t::iterator i = m_extensions.begin() + , end(m_extensions.end()); i != end; ++i) + { + try { (*i)->on_files_checked(); } catch (std::exception&) {} + } +#endif } alert_manager& torrent::alerts() const