diff --git a/docs/libtorrent_plugins.html b/docs/libtorrent_plugins.html index 0209a72a6..90a367ecc 100644 --- a/docs/libtorrent_plugins.html +++ b/docs/libtorrent_plugins.html @@ -34,9 +34,10 @@
libtorrent has a plugin interface for implementing extensions to the protocol. @@ -74,6 +75,22 @@ implement. These are called torre both found in the <libtorrent/extensions.hpp> header.
These plugins are instantiated for each torrent and possibly each peer, respectively.
+This is done by passing in a function or function object to +session::add_extension() or torrent_handle::add_extension() (if the +torrent has already been started and you want to hook in the extension at +run-time).
+The signature of the function is:
++boost::shared_ptr<torrent_plugin> (*)(torrent*, void*); ++
The first argument is the internal torrent object, the second argument +is the userdata passed to session::add_torrent() or +torrent_handle::add_extension().
+The function should return a boost::shared_ptr<torrent_plugin> which +may or may not be 0. If it is a null pointer, the extension is simply ignored +for this torrent. If it is a valid pointer (to a class inheriting +torrent_plugin), it will be associated with this torrent and callbacks +will be made on torrent events.
This is the base class for a torrent_plugin. Your derived class is (if added @@ -150,6 +169,16 @@ handler it will recurse back into your handler, so in order to invoke the standard handler, you have to keep your own state on whether you want standard behavior or overridden behavior.
+void on_files_checked(); ++
This function is called when the initial files of the torrent have been +checked. If there are no files to check, this function is called immediately.
+i.e. This function is always called when the torrent is in a state where it +can start downloading.
+You add torrents through the add_torrent() function where you give an @@ -456,6 +462,8 @@ content on disk for instance. For more information about the storage_interface.
The torrent_handle returned by add_torrent() can be used to retrieve information about the torrent's progress, its peers etc. It is also used to abort a torrent.
+The userdata parameter is optional and will be passed on to the extension +constructor functions, if any (see add_extension()).
The second overload that takes a tracker url and an info-hash instead of metadata
(torrent_info) can be used with torrents where (at least some) peers support
the metadata extension. For the overload to be available, libtorrent must be built
@@ -692,7 +700,7 @@ receive it through pop_alert()
This function adds an extension to this session. The argument is a function
diff --git a/docs/manual.rst b/docs/manual.rst
index 32b0f98a6..73e1dadc4 100644
--- a/docs/manual.rst
+++ b/docs/manual.rst
@@ -79,8 +79,10 @@ The ``session`` class has the following synopsis::
boost::intrusive_ptr
void add_extension(boost::function<
- boost::shared_ptr<torrent_plugin>(torrent*)> ext);
+ boost::shared_ptr<torrent_plugin>(torrent*, void*)> ext);