forked from premiere/premiere-libtorrent
Merge pull request #328 from arvidn/deprecate-tracker-login
deprecate set_tracker_login
This commit is contained in:
commit
e0959605b9
|
@ -491,7 +491,9 @@ void bind_torrent_handle()
|
||||||
.def("max_uploads", _(&torrent_handle::max_uploads))
|
.def("max_uploads", _(&torrent_handle::max_uploads))
|
||||||
.def("set_max_connections", _(&torrent_handle::set_max_connections))
|
.def("set_max_connections", _(&torrent_handle::set_max_connections))
|
||||||
.def("max_connections", _(&torrent_handle::max_connections))
|
.def("max_connections", _(&torrent_handle::max_connections))
|
||||||
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
.def("set_tracker_login", _(&torrent_handle::set_tracker_login))
|
.def("set_tracker_login", _(&torrent_handle::set_tracker_login))
|
||||||
|
#endif
|
||||||
.def("move_storage", _(move_storage0), (arg("path"), arg("flags") = 0))
|
.def("move_storage", _(move_storage0), (arg("path"), arg("flags") = 0))
|
||||||
.def("info_hash", _(&torrent_handle::info_hash))
|
.def("info_hash", _(&torrent_handle::info_hash))
|
||||||
.def("force_recheck", _(&torrent_handle::force_recheck))
|
.def("force_recheck", _(&torrent_handle::force_recheck))
|
||||||
|
|
|
@ -732,9 +732,11 @@ namespace libtorrent
|
||||||
void dht_announce();
|
void dht_announce();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
// sets the username and password that will be sent to
|
// sets the username and password that will be sent to
|
||||||
// the tracker
|
// the tracker
|
||||||
void set_tracker_login(std::string const& name, std::string const& pw);
|
void set_tracker_login(std::string const& name, std::string const& pw);
|
||||||
|
#endif
|
||||||
|
|
||||||
announce_entry* find_tracker(tracker_request const& r);
|
announce_entry* find_tracker(tracker_request const& r);
|
||||||
|
|
||||||
|
@ -1252,8 +1254,11 @@ namespace libtorrent
|
||||||
std::vector<time_critical_piece> m_time_critical_pieces;
|
std::vector<time_critical_piece> m_time_critical_pieces;
|
||||||
|
|
||||||
std::string m_trackerid;
|
std::string m_trackerid;
|
||||||
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
|
// deprecated in 1.1
|
||||||
std::string m_username;
|
std::string m_username;
|
||||||
std::string m_password;
|
std::string m_password;
|
||||||
|
#endif
|
||||||
|
|
||||||
std::string m_save_path;
|
std::string m_save_path;
|
||||||
|
|
||||||
|
|
|
@ -1154,10 +1154,13 @@ namespace libtorrent
|
||||||
void set_max_connections(int max_connections) const;
|
void set_max_connections(int max_connections) const;
|
||||||
int max_connections() const;
|
int max_connections() const;
|
||||||
|
|
||||||
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
// sets a username and password that will be sent along in the HTTP-request
|
// sets a username and password that will be sent along in the HTTP-request
|
||||||
// of the tracker announce. Set this if the tracker requires authorization.
|
// of the tracker announce. Set this if the tracker requires authorization.
|
||||||
|
TORRENT_DEPRECATED
|
||||||
void set_tracker_login(std::string const& name
|
void set_tracker_login(std::string const& name
|
||||||
, std::string const& password) const;
|
, std::string const& password) const;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Moves the file(s) that this torrent are currently seeding from or
|
// Moves the file(s) that this torrent are currently seeding from or
|
||||||
// downloading to. If the given ``save_path`` is not located on the same
|
// downloading to. If the given ``save_path`` is not located on the same
|
||||||
|
|
|
@ -128,7 +128,9 @@ namespace libtorrent
|
||||||
|
|
||||||
std::string url;
|
std::string url;
|
||||||
std::string trackerid;
|
std::string trackerid;
|
||||||
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
std::string auth;
|
std::string auth;
|
||||||
|
#endif
|
||||||
|
|
||||||
boost::shared_ptr<const ip_filter> filter;
|
boost::shared_ptr<const ip_filter> filter;
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,11 @@ namespace libtorrent
|
||||||
, tracker_req().event == tracker_request::stopped
|
, tracker_req().event == tracker_request::stopped
|
||||||
? resolver_interface::prefer_cache
|
? resolver_interface::prefer_cache
|
||||||
: resolver_interface::abort_on_shutdown
|
: resolver_interface::abort_on_shutdown
|
||||||
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
, tracker_req().auth
|
, tracker_req().auth
|
||||||
|
#else
|
||||||
|
, ""
|
||||||
|
#endif
|
||||||
#if TORRENT_USE_I2P
|
#if TORRENT_USE_I2P
|
||||||
, tracker_req().i2pconn
|
, tracker_req().i2pconn
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3215,7 +3215,9 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
req.auth = tracker_login();
|
req.auth = tracker_login();
|
||||||
|
#endif
|
||||||
req.key = tracker_key();
|
req.key = tracker_key();
|
||||||
|
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
|
@ -3282,7 +3284,9 @@ namespace libtorrent
|
||||||
req.info_hash = m_torrent_file->info_hash();
|
req.info_hash = m_torrent_file->info_hash();
|
||||||
req.kind |= tracker_request::scrape_request;
|
req.kind |= tracker_request::scrape_request;
|
||||||
req.url = m_trackers[i].url;
|
req.url = m_trackers[i].url;
|
||||||
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
req.auth = tracker_login();
|
req.auth = tracker_login();
|
||||||
|
#endif
|
||||||
req.key = tracker_key();
|
req.key = tracker_key();
|
||||||
m_ses.queue_tracker_request(req, shared_from_this());
|
m_ses.queue_tracker_request(req, shared_from_this());
|
||||||
}
|
}
|
||||||
|
@ -3695,6 +3699,7 @@ namespace libtorrent
|
||||||
update_tracker_timer(clock_type::now());
|
update_tracker_timer(clock_type::now());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
void torrent::set_tracker_login(
|
void torrent::set_tracker_login(
|
||||||
std::string const& name
|
std::string const& name
|
||||||
, std::string const& pw)
|
, std::string const& pw)
|
||||||
|
@ -3702,6 +3707,7 @@ namespace libtorrent
|
||||||
m_username = name;
|
m_username = name;
|
||||||
m_password = pw;
|
m_password = pw;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if TORRENT_USE_I2P
|
#if TORRENT_USE_I2P
|
||||||
void torrent::on_i2p_resolve(error_code const& ec, char const* dest)
|
void torrent::on_i2p_resolve(error_code const& ec, char const* dest)
|
||||||
|
@ -5060,12 +5066,13 @@ namespace libtorrent
|
||||||
alerts().emplace_alert<torrent_paused_alert>(get_handle());
|
alerts().emplace_alert<torrent_paused_alert>(get_handle());
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 2 the tracker login feature should probably be deprecated
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
std::string torrent::tracker_login() const
|
std::string torrent::tracker_login() const
|
||||||
{
|
{
|
||||||
if (m_username.empty() && m_password.empty()) return "";
|
if (m_username.empty() && m_password.empty()) return "";
|
||||||
return m_username + ":" + m_password;
|
return m_username + ":" + m_password;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
boost::uint32_t torrent::tracker_key() const
|
boost::uint32_t torrent::tracker_key() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -447,11 +447,13 @@ namespace libtorrent
|
||||||
TORRENT_ASYNC_CALL(clear_error);
|
TORRENT_ASYNC_CALL(clear_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
void torrent_handle::set_tracker_login(std::string const& name
|
void torrent_handle::set_tracker_login(std::string const& name
|
||||||
, std::string const& password) const
|
, std::string const& password) const
|
||||||
{
|
{
|
||||||
TORRENT_ASYNC_CALL2(set_tracker_login, name, password);
|
TORRENT_ASYNC_CALL2(set_tracker_login, name, password);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void torrent_handle::file_progress(std::vector<boost::int64_t>& progress, int flags) const
|
void torrent_handle::file_progress(std::vector<boost::int64_t>& progress, int flags) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue