diff --git a/include/libtorrent/extensions.hpp b/include/libtorrent/extensions.hpp index f59e2d68c..2cf21efa3 100644 --- a/include/libtorrent/extensions.hpp +++ b/include/libtorrent/extensions.hpp @@ -178,7 +178,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/error_code.hpp" #include "libtorrent/session_handle.hpp" #include "libtorrent/torrent_handle.hpp" -#include "libtorrent/peer_connection_handle.hpp" namespace libtorrent { @@ -191,6 +190,7 @@ namespace libtorrent class alert; struct torrent_plugin; struct add_torrent_params; + struct peer_connection_handle; // 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, @@ -219,7 +219,7 @@ namespace libtorrent // return true if the add_torrent_params should be added 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; } // called once per second @@ -264,7 +264,7 @@ namespace libtorrent // to it, use ``weak_ptr``. // // If this function throws an exception, the connection will be closed. - virtual boost::shared_ptr new_connection(peer_connection_handle) + virtual boost::shared_ptr new_connection(peer_connection_handle const&) { return boost::shared_ptr(); } // These hooks are called when a piece passes the hash check or fails the hash diff --git a/src/lt_trackers.cpp b/src/lt_trackers.cpp index 6d80ab672..6f3647b21 100644 --- a/src/lt_trackers.cpp +++ b/src/lt_trackers.cpp @@ -46,6 +46,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/peer_connection.hpp" #include "libtorrent/bt_peer_connection.hpp" +#include "libtorrent/peer_connection_handle.hpp" #include "libtorrent/hasher.hpp" #include "libtorrent/bencode.hpp" #include "libtorrent/torrent.hpp" @@ -79,7 +80,7 @@ namespace libtorrent { namespace } virtual boost::shared_ptr new_connection( - peer_connection_handle pc); + peer_connection_handle const& pc); virtual void tick() { @@ -360,7 +361,7 @@ namespace libtorrent { namespace }; boost::shared_ptr lt_tracker_plugin::new_connection( - peer_connection_handle pc) + peer_connection_handle const& pc) { if (pc.type() != peer_connection::bittorrent_connection) return boost::shared_ptr(); diff --git a/src/metadata_transfer.cpp b/src/metadata_transfer.cpp index ff86481aa..f0a8c6e37 100644 --- a/src/metadata_transfer.cpp +++ b/src/metadata_transfer.cpp @@ -47,6 +47,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/peer_connection.hpp" #include "libtorrent/bt_peer_connection.hpp" +#include "libtorrent/peer_connection_handle.hpp" #include "libtorrent/hasher.hpp" #include "libtorrent/bencode.hpp" #include "libtorrent/torrent.hpp" @@ -128,7 +129,7 @@ namespace libtorrent { namespace } virtual boost::shared_ptr new_connection( - peer_connection_handle pc); + peer_connection_handle const& pc); buffer::const_interval metadata() const { @@ -543,7 +544,7 @@ namespace libtorrent { namespace }; boost::shared_ptr metadata_plugin::new_connection( - peer_connection_handle pc) + peer_connection_handle const& pc) { if (pc.type() != peer_connection::bittorrent_connection) return boost::shared_ptr(); diff --git a/src/torrent.cpp b/src/torrent.cpp index 976c74bab..d073e8802 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -70,6 +70,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/bt_peer_connection.hpp" #include "libtorrent/web_peer_connection.hpp" #include "libtorrent/http_seed_connection.hpp" +#include "libtorrent/peer_connection_handle.hpp" #include "libtorrent/peer_id.hpp" #include "libtorrent/identify_client.hpp" #include "libtorrent/alert_types.hpp" diff --git a/src/ut_metadata.cpp b/src/ut_metadata.cpp index 96abe0550..37ee812a8 100644 --- a/src/ut_metadata.cpp +++ b/src/ut_metadata.cpp @@ -46,6 +46,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/peer_connection.hpp" #include "libtorrent/bt_peer_connection.hpp" +#include "libtorrent/peer_connection_handle.hpp" #include "libtorrent/hasher.hpp" #include "libtorrent/bencode.hpp" #include "libtorrent/torrent.hpp" @@ -124,7 +125,7 @@ namespace libtorrent { namespace } virtual boost::shared_ptr new_connection( - peer_connection_handle pc); + peer_connection_handle const& pc); int get_metadata_size() const { @@ -500,7 +501,7 @@ namespace libtorrent { namespace }; boost::shared_ptr ut_metadata_plugin::new_connection( - peer_connection_handle pc) + peer_connection_handle const& pc) { if (pc.type() != peer_connection::bittorrent_connection) return boost::shared_ptr(); diff --git a/src/ut_pex.cpp b/src/ut_pex.cpp index 8c4988e9c..a148ac07d 100644 --- a/src/ut_pex.cpp +++ b/src/ut_pex.cpp @@ -33,6 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/config.hpp" #include "libtorrent/peer_connection.hpp" #include "libtorrent/bt_peer_connection.hpp" +#include "libtorrent/peer_connection_handle.hpp" #include "libtorrent/bencode.hpp" #include "libtorrent/torrent.hpp" #include "libtorrent/extensions.hpp" @@ -90,7 +91,7 @@ namespace libtorrent { namespace , m_last_msg(min_time()) , m_peers_in_message(0) {} - virtual boost::shared_ptr new_connection(peer_connection_handle pc); + virtual boost::shared_ptr new_connection(peer_connection_handle const& pc); std::vector& get_ut_pex_msg() { @@ -646,7 +647,7 @@ namespace libtorrent { namespace bool m_first_time; }; - boost::shared_ptr ut_pex_plugin::new_connection(peer_connection_handle pc) + boost::shared_ptr ut_pex_plugin::new_connection(peer_connection_handle const& pc) { if (pc.type() != peer_connection::bittorrent_connection) return boost::shared_ptr();