-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support fetching tracker list from URL #21828
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,11 @@ class FileSearcher; | |
class FilterParserThread; | ||
class NativeSessionExtension; | ||
|
||
namespace Net | ||
{ | ||
struct DownloadResult; | ||
} | ||
|
||
namespace BitTorrent | ||
{ | ||
enum class MoveStorageMode; | ||
|
@@ -490,6 +495,12 @@ namespace BitTorrent | |
m_asyncWorker->start(std::forward<Func>(func)); | ||
} | ||
|
||
bool isAddTrackersFromURLEnabled() const override; | ||
void setAddTrackersFromURLEnabled(bool enabled) override; | ||
QString additionalTrackersURL() const override; | ||
void setAdditionalTrackersURL(const QString &url) override; | ||
QString additionalTrackersFromURL() const override; | ||
|
||
signals: | ||
void addTorrentAlertsReceived(qsizetype count); | ||
|
||
|
@@ -502,6 +513,7 @@ namespace BitTorrent | |
void handleIPFilterError(); | ||
void fileSearchFinished(const TorrentID &id, const Path &savePath, const PathList &fileNames); | ||
void torrentContentRemovingFinished(const QString &torrentName, const QString &errorMessage); | ||
void handleTrackersFromURLDownloadFinished(const Net::DownloadResult &result); | ||
|
||
private: | ||
struct ResumeSessionContext; | ||
|
@@ -596,6 +608,8 @@ namespace BitTorrent | |
void saveTorrentsQueue(); | ||
void removeTorrentsQueue(); | ||
|
||
void populateAdditionalTrackersFromURL(); | ||
|
||
std::vector<lt::alert *> getPendingAlerts(lt::time_duration time = lt::time_duration::zero()) const; | ||
|
||
void moveTorrentStorage(const MoveStorageJob &job) const; | ||
|
@@ -614,6 +628,9 @@ namespace BitTorrent | |
|
||
void handleRemovedTorrent(const TorrentID &torrentID, const QString &partfileRemoveError = {}); | ||
|
||
void setAdditionalTrackersFromURL(const QString &trackers); | ||
void updateTrackersFromURL(); | ||
|
||
CachedSettingValue<QString> m_DHTBootstrapNodes; | ||
CachedSettingValue<bool> m_isDHTEnabled; | ||
CachedSettingValue<bool> m_isLSDEnabled; | ||
|
@@ -676,6 +693,8 @@ namespace BitTorrent | |
CachedSettingValue<bool> m_blockPeersOnPrivilegedPorts; | ||
CachedSettingValue<bool> m_isAddTrackersEnabled; | ||
CachedSettingValue<QString> m_additionalTrackers; | ||
CachedSettingValue<bool> m_isAddTrackersFromURLEnabled; | ||
CachedSettingValue<QString> m_additionalTrackersURL; | ||
CachedSettingValue<qreal> m_globalMaxRatio; | ||
CachedSettingValue<int> m_globalMaxSeedingMinutes; | ||
CachedSettingValue<int> m_globalMaxInactiveSeedingMinutes; | ||
|
@@ -749,6 +768,9 @@ namespace BitTorrent | |
bool m_IPFilteringConfigured = false; | ||
mutable bool m_listenInterfaceConfigured = false; | ||
|
||
QString m_additionalTrackersFromURL; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems you don't really need this since you already have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is mostly useful for the comparison against the existing tracker list to determine if we need to call |
||
QTimer *m_updateTrackersFromURLTimer = nullptr; | ||
|
||
bool m_isRestored = false; | ||
bool m_isPaused = isStartPaused(); | ||
|
||
|
@@ -759,6 +781,7 @@ namespace BitTorrent | |
|
||
int m_numResumeData = 0; | ||
QList<TrackerEntry> m_additionalTrackerEntries; | ||
QList<TrackerEntry> m_additionalTrackerEntriesFromURL; | ||
QList<QRegularExpression> m_excludedFileNamesRegExpList; | ||
|
||
// Statistics | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy paste error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copied from the code block directly above, though I believe it's intentional so that
p.trackers
andp.tracker_tiers
are always the same size.