make it possible to add torrent plugins via add_torrent_params
This commit is contained in:
parent
755cdd00ff
commit
9319c1e073
|
@ -321,6 +321,10 @@ namespace libtorrent
|
||||||
int max_connections;
|
int max_connections;
|
||||||
int upload_limit;
|
int upload_limit;
|
||||||
int download_limit;
|
int download_limit;
|
||||||
|
|
||||||
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
|
std::vector<boost::function<boost::shared_ptr<torrent_plugin>(torrent*, void*)> > extensions;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5206,6 +5206,17 @@ retry:
|
||||||
torrent_ptr->start();
|
torrent_ptr->start();
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
|
typedef std::vector<boost::function<
|
||||||
|
boost::shared_ptr<torrent_plugin>(torrent*, void*)> >
|
||||||
|
torrent_plugins_t;
|
||||||
|
|
||||||
|
for (torrent_plugins_t::const_iterator i = params.extensions.begin()
|
||||||
|
, end(params.extensions.end()); i != end; ++i)
|
||||||
|
{
|
||||||
|
torrent_ptr->add_extension((*i)(torrent_ptr.get(),
|
||||||
|
params.userdata));
|
||||||
|
}
|
||||||
|
|
||||||
for (ses_extension_list_t::iterator i = m_ses_extensions.begin()
|
for (ses_extension_list_t::iterator i = m_ses_extensions.begin()
|
||||||
, end(m_ses_extensions.end()); i != end; ++i)
|
, end(m_ses_extensions.end()); i != end; ++i)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue