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("set_max_connections", _(&torrent_handle::set_max_connections))
|
||||
.def("max_connections", _(&torrent_handle::max_connections))
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
.def("set_tracker_login", _(&torrent_handle::set_tracker_login))
|
||||
#endif
|
||||
.def("move_storage", _(move_storage0), (arg("path"), arg("flags") = 0))
|
||||
.def("info_hash", _(&torrent_handle::info_hash))
|
||||
.def("force_recheck", _(&torrent_handle::force_recheck))
|
||||
|
|
|
@ -732,9 +732,11 @@ namespace libtorrent
|
|||
void dht_announce();
|
||||
#endif
|
||||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
// sets the username and password that will be sent to
|
||||
// the tracker
|
||||
void set_tracker_login(std::string const& name, std::string const& pw);
|
||||
#endif
|
||||
|
||||
announce_entry* find_tracker(tracker_request const& r);
|
||||
|
||||
|
@ -1252,8 +1254,11 @@ namespace libtorrent
|
|||
std::vector<time_critical_piece> m_time_critical_pieces;
|
||||
|
||||
std::string m_trackerid;
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
// deprecated in 1.1
|
||||
std::string m_username;
|
||||
std::string m_password;
|
||||
#endif
|
||||
|
||||
std::string m_save_path;
|
||||
|
||||
|
|
|
@ -1154,10 +1154,13 @@ namespace libtorrent
|
|||
void set_max_connections(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
|
||||
// of the tracker announce. Set this if the tracker requires authorization.
|
||||
TORRENT_DEPRECATED
|
||||
void set_tracker_login(std::string const& name
|
||||
, std::string const& password) const;
|
||||
#endif
|
||||
|
||||
// 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
|
||||
|
|
|
@ -128,7 +128,9 @@ namespace libtorrent
|
|||
|
||||
std::string url;
|
||||
std::string trackerid;
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
std::string auth;
|
||||
#endif
|
||||
|
||||
boost::shared_ptr<const ip_filter> filter;
|
||||
|
||||
|
|
|
@ -225,7 +225,11 @@ namespace libtorrent
|
|||
, tracker_req().event == tracker_request::stopped
|
||||
? resolver_interface::prefer_cache
|
||||
: resolver_interface::abort_on_shutdown
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
, tracker_req().auth
|
||||
#else
|
||||
, ""
|
||||
#endif
|
||||
#if TORRENT_USE_I2P
|
||||
, tracker_req().i2pconn
|
||||
#endif
|
||||
|
|
|
@ -3215,7 +3215,9 @@ namespace libtorrent
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
req.auth = tracker_login();
|
||||
#endif
|
||||
req.key = tracker_key();
|
||||
|
||||
#ifdef TORRENT_USE_OPENSSL
|
||||
|
@ -3282,7 +3284,9 @@ namespace libtorrent
|
|||
req.info_hash = m_torrent_file->info_hash();
|
||||
req.kind |= tracker_request::scrape_request;
|
||||
req.url = m_trackers[i].url;
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
req.auth = tracker_login();
|
||||
#endif
|
||||
req.key = tracker_key();
|
||||
m_ses.queue_tracker_request(req, shared_from_this());
|
||||
}
|
||||
|
@ -3695,6 +3699,7 @@ namespace libtorrent
|
|||
update_tracker_timer(clock_type::now());
|
||||
}
|
||||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
void torrent::set_tracker_login(
|
||||
std::string const& name
|
||||
, std::string const& pw)
|
||||
|
@ -3702,6 +3707,7 @@ namespace libtorrent
|
|||
m_username = name;
|
||||
m_password = pw;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TORRENT_USE_I2P
|
||||
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());
|
||||
}
|
||||
|
||||
// TODO: 2 the tracker login feature should probably be deprecated
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
std::string torrent::tracker_login() const
|
||||
{
|
||||
if (m_username.empty() && m_password.empty()) return "";
|
||||
return m_username + ":" + m_password;
|
||||
}
|
||||
#endif
|
||||
|
||||
boost::uint32_t torrent::tracker_key() const
|
||||
{
|
||||
|
|
|
@ -447,11 +447,13 @@ namespace libtorrent
|
|||
TORRENT_ASYNC_CALL(clear_error);
|
||||
}
|
||||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
void torrent_handle::set_tracker_login(std::string const& name
|
||||
, std::string const& password) const
|
||||
{
|
||||
TORRENT_ASYNC_CALL2(set_tracker_login, name, password);
|
||||
}
|
||||
#endif
|
||||
|
||||
void torrent_handle::file_progress(std::vector<boost::int64_t>& progress, int flags) const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue