Moved TrackerList and TrackerController out of the public API.

This commit is contained in:
Jari Sundell
2025-05-28 10:11:29 +02:00
committed by GitHub
parent 5fb61b2857
commit de6c48ca3f
12 changed files with 87 additions and 73 deletions
+11 -8
View File
@@ -10,7 +10,6 @@
#include <torrent/rate.h>
#include <torrent/throttle.h>
#include <torrent/torrent.h>
#include <torrent/tracker_list.h>
#include <torrent/tracker/tracker.h>
#include <torrent/data/file_list.h>
#include <torrent/data/file_manager.h>
@@ -160,14 +159,18 @@ print_download_status(char* first, char* last, core::Download* d) {
first = print_buffer(first, last, "Checking hash [%2i%%]",
(d->download()->chunks_hashed() * 100) / d->download()->file_list()->size_chunks());
} else if (d->tracker_list()->has_active_not_scrape()) {
torrent::TrackerList::iterator itr =
std::find_if(d->tracker_list()->begin(), d->tracker_list()->end(),
std::mem_fn(&torrent::tracker::Tracker::is_busy_not_scrape));
auto status = itr->status();
} else if (d->tracker_controller().has_active_trackers_not_scrape()) {
auto tracker = d->tracker_controller().find_if([](const auto& t) {
return t.is_busy_not_scrape();
});
first = print_buffer(first, last, "Tracker[%i:%i]: Connecting to %s %s",
itr->group(), std::distance(d->tracker_list()->begin(), itr), itr->url().c_str(), status.c_str());
if (tracker.is_valid()) {
auto status = tracker.status();
first = print_buffer(first, last, "Tracker[%i]: Connecting to %s %s", tracker.group(), tracker.url().c_str(), status.c_str());
} else {
first = print_buffer(first, last, "Tracker: Connecting ...");
}
} else if (!d->message().empty()) {
first = print_buffer(first, last, "%s", d->message().c_str());