fix some deprecation issues (use interfa)
This commit is contained in:
parent
d4032c6101
commit
01c42720e1
|
@ -1019,9 +1019,7 @@ bool handle_alert(libtorrent::session& ses, libtorrent::alert* a
|
|||
h.set_max_uploads(-1);
|
||||
h.set_upload_limit(torrent_upload_limit);
|
||||
h.set_download_limit(torrent_download_limit);
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
h.use_interface(outgoing_interface.c_str());
|
||||
#endif
|
||||
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
|
||||
h.resolve_countries(true);
|
||||
#endif
|
||||
|
|
|
@ -760,15 +760,6 @@ namespace libtorrent
|
|||
TORRENT_DEPRECATED_PREFIX
|
||||
void filter_files(std::vector<bool> const& files) const TORRENT_DEPRECATED;
|
||||
|
||||
// ``use_interface()`` sets the network interface this torrent will use when it opens outgoing
|
||||
// connections. By default, it uses the same interface as the session uses to listen on. The
|
||||
// parameter must be a string containing one or more, comma separated, ip-address (either an
|
||||
// IPv4 or IPv6 address). When specifying multiple interfaces, the torrent will round-robin
|
||||
// which interface to use for each outgoing conneciton. This is useful for clients that are
|
||||
// multi-homed.
|
||||
TORRENT_DEPRECATED_PREFIX
|
||||
void use_interface(const char* net_interface) const TORRENT_DEPRECATED;
|
||||
|
||||
// deprecated in 0.14
|
||||
// use save_resume_data() instead. It is async. and
|
||||
// will return the resume data in an alert
|
||||
|
@ -777,6 +768,14 @@ namespace libtorrent
|
|||
// ================ end deprecation ============
|
||||
#endif
|
||||
|
||||
// ``use_interface()`` sets the network interface this torrent will use when it opens outgoing
|
||||
// connections. By default, it uses the same interface as the session uses to listen on. The
|
||||
// parameter must be a string containing one or more, comma separated, ip-address (either an
|
||||
// IPv4 or IPv6 address). When specifying multiple interfaces, the torrent will round-robin
|
||||
// which interface to use for each outgoing conneciton. This is useful for clients that are
|
||||
// multi-homed.
|
||||
void use_interface(const char* net_interface) const;
|
||||
|
||||
// Fills the specified ``std::vector<int>`` with the availability for each
|
||||
// piece in this torrent. libtorrent does not keep track of availability for
|
||||
// seeds, so if the torrent is seeding the availability for all pieces is
|
||||
|
|
|
@ -230,11 +230,6 @@ namespace libtorrent
|
|||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
file_storage::iterator file_storage::file_at_offset_deprecated(size_type offset) const
|
||||
{
|
||||
return file_at_offset(offset);
|
||||
}
|
||||
|
||||
file_storage::iterator file_storage::file_at_offset(size_type offset) const
|
||||
{
|
||||
// find the file iterator and file offset
|
||||
internal_file_entry target;
|
||||
|
@ -242,12 +237,17 @@ namespace libtorrent
|
|||
TORRENT_ASSERT(!compare_file_offset(target, m_files.front()));
|
||||
|
||||
std::vector<internal_file_entry>::const_iterator file_iter = std::upper_bound(
|
||||
begin(), end(), target, compare_file_offset);
|
||||
begin_deprecated(), end_deprecated(), target, compare_file_offset);
|
||||
|
||||
TORRENT_ASSERT(file_iter != begin());
|
||||
TORRENT_ASSERT(file_iter != begin_deprecated());
|
||||
--file_iter;
|
||||
return file_iter;
|
||||
}
|
||||
|
||||
file_storage::iterator file_storage::file_at_offset(size_type offset) const
|
||||
{
|
||||
return file_at_offset_deprecated(offset);
|
||||
}
|
||||
#endif
|
||||
|
||||
int file_storage::file_index_at_offset(size_type offset) const
|
||||
|
|
|
@ -589,15 +589,15 @@ namespace libtorrent
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
// ============ start deprecation ===============
|
||||
|
||||
void torrent_handle::use_interface(const char* net_interface) const
|
||||
{
|
||||
INVARIANT_CHECK;
|
||||
TORRENT_ASYNC_CALL1(use_interface, std::string(net_interface));
|
||||
}
|
||||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
// ============ start deprecation ===============
|
||||
|
||||
#if !TORRENT_NO_FPU
|
||||
void torrent_handle::file_progress(std::vector<float>& progress) const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue