merged fixes from RC_0_16

This commit is contained in:
Arvid Norberg
2013-09-07 21:27:07 +00:00
parent 288f203a92
commit 7c66c2911f
4 changed files with 20 additions and 3 deletions

View File

@@ -311,11 +311,25 @@ void connect_peer(torrent_handle& th, tuple ip, int source)
}
#ifndef TORRENT_NO_DEPRECATE
#if BOOST_VERSION > 104200
boost::intrusive_ptr<const torrent_info> get_torrent_info(torrent_handle const& h)
{
return boost::intrusive_ptr<const torrent_info>(&h.get_torrent_info());
return boost::intrusive_ptr<const torrent_info>(&h.get_torrent_info());
}
#else
boost::intrusive_ptr<torrent_info> get_torrent_info(torrent_handle const& h)
{
// I can't figure out how to expose intrusive_ptr<const torrent_info>
// as well as supporting mutable instances. So, this hack is better
// than compilation errors. It seems to work on newer versions of boost though
return boost::intrusive_ptr<torrent_info>(const_cast<torrent_info*>(&h.get_torrent_info()));
}
#endif
void set_peer_upload_limit(torrent_handle& th, tuple const& ip, int limit)
{
th.set_peer_upload_limit(tuple_to_endpoint(ip), limit);

View File

@@ -285,7 +285,9 @@ void bind_torrent_info()
.value("source_tex", announce_entry::source_tex)
;
#if BOOST_VERSION > 104200
implicitly_convertible<boost::intrusive_ptr<torrent_info>, boost::intrusive_ptr<const torrent_info> >();
boost::python::register_ptr_to_python<boost::intrusive_ptr<const torrent_info> >();
#endif
}