mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-06 18:22:32 +00:00
Moved TrackerList and TrackerController out of the public API.
This commit is contained in:
+16
-4
@@ -62,11 +62,23 @@ apply_dht_add_node(const std::string& arg) {
|
||||
|
||||
torrent::Object
|
||||
apply_enable_trackers(int64_t arg) {
|
||||
for (core::Manager::DListItr itr = control->core()->download_list()->begin(), last = control->core()->download_list()->end(); itr != last; ++itr) {
|
||||
std::for_each((*itr)->tracker_list()->begin(), (*itr)->tracker_list()->end(), std::mem_fn(arg ? &torrent::tracker::Tracker::enable : &torrent::tracker::Tracker::disable));
|
||||
if (arg == 0) {
|
||||
for (auto itr : *control->core()->download_list())
|
||||
itr->tracker_controller().for_each([](auto& tracker) { tracker.disable(); });
|
||||
|
||||
if (arg && !rpc::call_command_value("trackers.use_udp"))
|
||||
(*itr)->enable_udp_trackers(false);
|
||||
} else if (rpc::call_command_value("trackers.use_udp") == 0) {
|
||||
for (auto itr : *control->core()->download_list()) {
|
||||
itr->tracker_controller().for_each([](auto& tracker) {
|
||||
if (tracker.type() == torrent::TRACKER_UDP)
|
||||
tracker.disable();
|
||||
else
|
||||
tracker.enable();
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
for (auto itr : *control->core()->download_list())
|
||||
itr->tracker_controller().for_each([](auto& tracker) { tracker.enable(); });
|
||||
}
|
||||
|
||||
return torrent::Object();
|
||||
|
||||
Reference in New Issue
Block a user