mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 19:22:29 +00:00
Moved TrackerList and TrackerController out of the public API.
This commit is contained in:
+11
-8
@@ -6,7 +6,6 @@
|
||||
#include <torrent/exceptions.h>
|
||||
#include <torrent/rate.h>
|
||||
#include <torrent/torrent.h>
|
||||
#include <torrent/tracker_list.h>
|
||||
#include <torrent/tracker/tracker.h>
|
||||
#include <torrent/data/file_list.h>
|
||||
|
||||
@@ -38,13 +37,17 @@ Download::~Download() {
|
||||
|
||||
void
|
||||
Download::enable_udp_trackers(bool state) {
|
||||
for (torrent::TrackerList::iterator itr = m_download.tracker_list()->begin(), last = m_download.tracker_list()->end(); itr != last; ++itr)
|
||||
if (itr->type() == torrent::TRACKER_UDP) {
|
||||
if (state)
|
||||
itr->enable();
|
||||
else
|
||||
itr->disable();
|
||||
}
|
||||
for (int idx = 0, end = m_download.tracker_controller().size(); idx < end; ++idx) {
|
||||
auto tracker = m_download.tracker_controller().at(idx);
|
||||
|
||||
if (tracker.type() != torrent::TRACKER_UDP)
|
||||
continue;
|
||||
|
||||
if (state)
|
||||
tracker.enable();
|
||||
else
|
||||
tracker.disable();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
||||
+2
-3
@@ -5,9 +5,9 @@
|
||||
#include <torrent/download.h>
|
||||
#include <torrent/download_info.h>
|
||||
#include <torrent/hash_string.h>
|
||||
#include <torrent/tracker_list.h>
|
||||
#include <torrent/data/file_list.h>
|
||||
#include <torrent/peer/connection_list.h>
|
||||
#include <torrent/tracker/wrappers.h>
|
||||
|
||||
#include "globals.h"
|
||||
|
||||
@@ -62,8 +62,7 @@ public:
|
||||
torrent::Object* bencode() { return m_download.bencode(); }
|
||||
|
||||
auto tracker_controller() { return m_download.tracker_controller(); }
|
||||
tracker_list_type* tracker_list() { return m_download.tracker_list(); }
|
||||
uint32_t tracker_list_size() const { return m_download.tracker_list()->size(); }
|
||||
uint32_t tracker_list_size() const { return m_download.c_tracker_controller().size(); }
|
||||
|
||||
auto connection_list() { return m_download.connection_list(); }
|
||||
uint32_t connection_list_size() const;
|
||||
|
||||
@@ -225,7 +225,7 @@ DownloadFactory::receive_success() {
|
||||
torrent::Object* rtorrent = &root->insert_preserve_copy("rtorrent", torrent::Object::create_map()).first->second;
|
||||
torrent::Object& resumeObject = root->insert_preserve_copy("libtorrent_resume", torrent::Object::create_map()).first->second;
|
||||
|
||||
rtorrent->insert_key("key", download->tracker_list()->key());
|
||||
rtorrent->insert_key("key", download->tracker_controller().key());
|
||||
|
||||
initialize_rtorrent(download, rtorrent);
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <torrent/error.h>
|
||||
#include <torrent/exceptions.h>
|
||||
#include <torrent/object_stream.h>
|
||||
#include <torrent/tracker_list.h>
|
||||
#include <torrent/throttle.h>
|
||||
#include <torrent/utils/log.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user