pass peer_connection_handle by const ref in the plugin api
This commit is contained in:
parent
423a18ecb1
commit
72dcc20073
|
@ -178,7 +178,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/error_code.hpp"
|
#include "libtorrent/error_code.hpp"
|
||||||
#include "libtorrent/session_handle.hpp"
|
#include "libtorrent/session_handle.hpp"
|
||||||
#include "libtorrent/torrent_handle.hpp"
|
#include "libtorrent/torrent_handle.hpp"
|
||||||
#include "libtorrent/peer_connection_handle.hpp"
|
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
|
@ -191,6 +190,7 @@ namespace libtorrent
|
||||||
class alert;
|
class alert;
|
||||||
struct torrent_plugin;
|
struct torrent_plugin;
|
||||||
struct add_torrent_params;
|
struct add_torrent_params;
|
||||||
|
struct peer_connection_handle;
|
||||||
|
|
||||||
// this is the base class for a session plugin. One primary feature
|
// this is the base class for a session plugin. One primary feature
|
||||||
// is that it is notified of all torrents that are added to the session,
|
// is that it is notified of all torrents that are added to the session,
|
||||||
|
@ -219,7 +219,7 @@ namespace libtorrent
|
||||||
|
|
||||||
// return true if the add_torrent_params should be added
|
// return true if the add_torrent_params should be added
|
||||||
virtual bool on_unknown_torrent(sha1_hash const& /* info_hash */
|
virtual bool on_unknown_torrent(sha1_hash const& /* info_hash */
|
||||||
, peer_connection_handle /* pc */, add_torrent_params& /* p */)
|
, peer_connection_handle const& /* pc */, add_torrent_params& /* p */)
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
// called once per second
|
// called once per second
|
||||||
|
@ -264,7 +264,7 @@ namespace libtorrent
|
||||||
// to it, use ``weak_ptr``.
|
// to it, use ``weak_ptr``.
|
||||||
//
|
//
|
||||||
// If this function throws an exception, the connection will be closed.
|
// If this function throws an exception, the connection will be closed.
|
||||||
virtual boost::shared_ptr<peer_plugin> new_connection(peer_connection_handle)
|
virtual boost::shared_ptr<peer_plugin> new_connection(peer_connection_handle const&)
|
||||||
{ return boost::shared_ptr<peer_plugin>(); }
|
{ return boost::shared_ptr<peer_plugin>(); }
|
||||||
|
|
||||||
// These hooks are called when a piece passes the hash check or fails the hash
|
// These hooks are called when a piece passes the hash check or fails the hash
|
||||||
|
|
|
@ -46,6 +46,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/peer_connection.hpp"
|
#include "libtorrent/peer_connection.hpp"
|
||||||
#include "libtorrent/bt_peer_connection.hpp"
|
#include "libtorrent/bt_peer_connection.hpp"
|
||||||
|
#include "libtorrent/peer_connection_handle.hpp"
|
||||||
#include "libtorrent/hasher.hpp"
|
#include "libtorrent/hasher.hpp"
|
||||||
#include "libtorrent/bencode.hpp"
|
#include "libtorrent/bencode.hpp"
|
||||||
#include "libtorrent/torrent.hpp"
|
#include "libtorrent/torrent.hpp"
|
||||||
|
@ -79,7 +80,7 @@ namespace libtorrent { namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual boost::shared_ptr<peer_plugin> new_connection(
|
virtual boost::shared_ptr<peer_plugin> new_connection(
|
||||||
peer_connection_handle pc);
|
peer_connection_handle const& pc);
|
||||||
|
|
||||||
virtual void tick()
|
virtual void tick()
|
||||||
{
|
{
|
||||||
|
@ -360,7 +361,7 @@ namespace libtorrent { namespace
|
||||||
};
|
};
|
||||||
|
|
||||||
boost::shared_ptr<peer_plugin> lt_tracker_plugin::new_connection(
|
boost::shared_ptr<peer_plugin> lt_tracker_plugin::new_connection(
|
||||||
peer_connection_handle pc)
|
peer_connection_handle const& pc)
|
||||||
{
|
{
|
||||||
if (pc.type() != peer_connection::bittorrent_connection)
|
if (pc.type() != peer_connection::bittorrent_connection)
|
||||||
return boost::shared_ptr<peer_plugin>();
|
return boost::shared_ptr<peer_plugin>();
|
||||||
|
|
|
@ -47,6 +47,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/peer_connection.hpp"
|
#include "libtorrent/peer_connection.hpp"
|
||||||
#include "libtorrent/bt_peer_connection.hpp"
|
#include "libtorrent/bt_peer_connection.hpp"
|
||||||
|
#include "libtorrent/peer_connection_handle.hpp"
|
||||||
#include "libtorrent/hasher.hpp"
|
#include "libtorrent/hasher.hpp"
|
||||||
#include "libtorrent/bencode.hpp"
|
#include "libtorrent/bencode.hpp"
|
||||||
#include "libtorrent/torrent.hpp"
|
#include "libtorrent/torrent.hpp"
|
||||||
|
@ -128,7 +129,7 @@ namespace libtorrent { namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual boost::shared_ptr<peer_plugin> new_connection(
|
virtual boost::shared_ptr<peer_plugin> new_connection(
|
||||||
peer_connection_handle pc);
|
peer_connection_handle const& pc);
|
||||||
|
|
||||||
buffer::const_interval metadata() const
|
buffer::const_interval metadata() const
|
||||||
{
|
{
|
||||||
|
@ -543,7 +544,7 @@ namespace libtorrent { namespace
|
||||||
};
|
};
|
||||||
|
|
||||||
boost::shared_ptr<peer_plugin> metadata_plugin::new_connection(
|
boost::shared_ptr<peer_plugin> metadata_plugin::new_connection(
|
||||||
peer_connection_handle pc)
|
peer_connection_handle const& pc)
|
||||||
{
|
{
|
||||||
if (pc.type() != peer_connection::bittorrent_connection)
|
if (pc.type() != peer_connection::bittorrent_connection)
|
||||||
return boost::shared_ptr<peer_plugin>();
|
return boost::shared_ptr<peer_plugin>();
|
||||||
|
|
|
@ -70,6 +70,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/bt_peer_connection.hpp"
|
#include "libtorrent/bt_peer_connection.hpp"
|
||||||
#include "libtorrent/web_peer_connection.hpp"
|
#include "libtorrent/web_peer_connection.hpp"
|
||||||
#include "libtorrent/http_seed_connection.hpp"
|
#include "libtorrent/http_seed_connection.hpp"
|
||||||
|
#include "libtorrent/peer_connection_handle.hpp"
|
||||||
#include "libtorrent/peer_id.hpp"
|
#include "libtorrent/peer_id.hpp"
|
||||||
#include "libtorrent/identify_client.hpp"
|
#include "libtorrent/identify_client.hpp"
|
||||||
#include "libtorrent/alert_types.hpp"
|
#include "libtorrent/alert_types.hpp"
|
||||||
|
|
|
@ -46,6 +46,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/peer_connection.hpp"
|
#include "libtorrent/peer_connection.hpp"
|
||||||
#include "libtorrent/bt_peer_connection.hpp"
|
#include "libtorrent/bt_peer_connection.hpp"
|
||||||
|
#include "libtorrent/peer_connection_handle.hpp"
|
||||||
#include "libtorrent/hasher.hpp"
|
#include "libtorrent/hasher.hpp"
|
||||||
#include "libtorrent/bencode.hpp"
|
#include "libtorrent/bencode.hpp"
|
||||||
#include "libtorrent/torrent.hpp"
|
#include "libtorrent/torrent.hpp"
|
||||||
|
@ -124,7 +125,7 @@ namespace libtorrent { namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual boost::shared_ptr<peer_plugin> new_connection(
|
virtual boost::shared_ptr<peer_plugin> new_connection(
|
||||||
peer_connection_handle pc);
|
peer_connection_handle const& pc);
|
||||||
|
|
||||||
int get_metadata_size() const
|
int get_metadata_size() const
|
||||||
{
|
{
|
||||||
|
@ -500,7 +501,7 @@ namespace libtorrent { namespace
|
||||||
};
|
};
|
||||||
|
|
||||||
boost::shared_ptr<peer_plugin> ut_metadata_plugin::new_connection(
|
boost::shared_ptr<peer_plugin> ut_metadata_plugin::new_connection(
|
||||||
peer_connection_handle pc)
|
peer_connection_handle const& pc)
|
||||||
{
|
{
|
||||||
if (pc.type() != peer_connection::bittorrent_connection)
|
if (pc.type() != peer_connection::bittorrent_connection)
|
||||||
return boost::shared_ptr<peer_plugin>();
|
return boost::shared_ptr<peer_plugin>();
|
||||||
|
|
|
@ -33,6 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/config.hpp"
|
#include "libtorrent/config.hpp"
|
||||||
#include "libtorrent/peer_connection.hpp"
|
#include "libtorrent/peer_connection.hpp"
|
||||||
#include "libtorrent/bt_peer_connection.hpp"
|
#include "libtorrent/bt_peer_connection.hpp"
|
||||||
|
#include "libtorrent/peer_connection_handle.hpp"
|
||||||
#include "libtorrent/bencode.hpp"
|
#include "libtorrent/bencode.hpp"
|
||||||
#include "libtorrent/torrent.hpp"
|
#include "libtorrent/torrent.hpp"
|
||||||
#include "libtorrent/extensions.hpp"
|
#include "libtorrent/extensions.hpp"
|
||||||
|
@ -90,7 +91,7 @@ namespace libtorrent { namespace
|
||||||
, m_last_msg(min_time())
|
, m_last_msg(min_time())
|
||||||
, m_peers_in_message(0) {}
|
, m_peers_in_message(0) {}
|
||||||
|
|
||||||
virtual boost::shared_ptr<peer_plugin> new_connection(peer_connection_handle pc);
|
virtual boost::shared_ptr<peer_plugin> new_connection(peer_connection_handle const& pc);
|
||||||
|
|
||||||
std::vector<char>& get_ut_pex_msg()
|
std::vector<char>& get_ut_pex_msg()
|
||||||
{
|
{
|
||||||
|
@ -646,7 +647,7 @@ namespace libtorrent { namespace
|
||||||
bool m_first_time;
|
bool m_first_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
boost::shared_ptr<peer_plugin> ut_pex_plugin::new_connection(peer_connection_handle pc)
|
boost::shared_ptr<peer_plugin> ut_pex_plugin::new_connection(peer_connection_handle const& pc)
|
||||||
{
|
{
|
||||||
if (pc.type() != peer_connection::bittorrent_connection)
|
if (pc.type() != peer_connection::bittorrent_connection)
|
||||||
return boost::shared_ptr<peer_plugin>();
|
return boost::shared_ptr<peer_plugin>();
|
||||||
|
|
Loading…
Reference in New Issue