Delay subsequent requests to the same host

PR #19801.
Closes #8350.
This commit is contained in:
jNullj
2024-01-19 19:38:16 +02:00
committed by GitHub
parent 8ec3db1807
commit c5d7b62473
13 changed files with 98 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2024 Jonathan Ketchker
* Copyright (C) 2015-2022 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2010 Christophe Dumez <chris@qbittorrent.org>
* Copyright (C) 2010 Arnaud Demaiziere <arnaud@qbittorrent.org>
@@ -98,7 +99,7 @@ Feed::Feed(const QUuid &uid, const QString &url, const QString &path, Session *s
else
connect(m_session, &Session::processingStateChanged, this, &Feed::handleSessionProcessingEnabledChanged);
Net::DownloadManager::instance()->registerSequentialService(Net::ServiceID::fromURL(m_url));
Net::DownloadManager::instance()->registerSequentialService(Net::ServiceID::fromURL(m_url), m_session->fetchDelay());
load();
}
@@ -159,6 +160,12 @@ void Feed::refresh()
emit stateChanged(this);
}
void Feed::updateFetchDelay()
{
// Update delay values for registered sequential services
Net::DownloadManager::instance()->registerSequentialService(Net::ServiceID::fromURL(m_url), m_session->fetchDelay());
}
QUuid Feed::uid() const
{
return m_uid;