mirror of
https://github.com/overte-org/overte.git
synced 2025-08-13 05:30:18 +02:00
Disable request limiting for ATP requests in ResourceCache
This commit is contained in:
parent
12d3cf557a
commit
b401a62d7f
3 changed files with 14 additions and 8 deletions
|
@ -161,7 +161,11 @@ void ResourceCache::attemptRequest(Resource* resource) {
|
|||
return;
|
||||
}
|
||||
qDebug() << "-- Decreasing limit for : " << resource->getURL();
|
||||
_requestLimit--;
|
||||
|
||||
// Disable request limiting for ATP
|
||||
if (resource->getURL() != URL_SCHEME_ATP) {
|
||||
_requestLimit--;
|
||||
}
|
||||
sharedItems->_loadingRequests.append(resource);
|
||||
resource->makeRequest();
|
||||
}
|
||||
|
@ -171,7 +175,9 @@ void ResourceCache::requestCompleted(Resource* resource) {
|
|||
auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>();
|
||||
sharedItems->_loadingRequests.removeOne(resource);
|
||||
qDebug() << "++ Increasing limit after finished: " << resource->getURL();
|
||||
_requestLimit++;
|
||||
if (resource->getURL() != URL_SCHEME_ATP) {
|
||||
_requestLimit++;
|
||||
}
|
||||
|
||||
// look for the highest priority pending request
|
||||
int highestIndex = -1;
|
||||
|
|
|
@ -16,12 +16,6 @@
|
|||
|
||||
#include <SharedUtil.h>
|
||||
|
||||
const QString URL_SCHEME_FILE = "file";
|
||||
const QString URL_SCHEME_HTTP = "http";
|
||||
const QString URL_SCHEME_HTTPS = "https";
|
||||
const QString URL_SCHEME_FTP = "ftp";
|
||||
const QString URL_SCHEME_ATP = "atp";
|
||||
|
||||
ResourceRequest* ResourceManager::createResourceRequest(QObject* parent, const QUrl& url) {
|
||||
auto scheme = url.scheme();
|
||||
if (scheme == URL_SCHEME_FILE) {
|
||||
|
|
|
@ -15,6 +15,12 @@
|
|||
|
||||
#include "ResourceRequest.h"
|
||||
|
||||
const QString URL_SCHEME_FILE = "file";
|
||||
const QString URL_SCHEME_HTTP = "http";
|
||||
const QString URL_SCHEME_HTTPS = "https";
|
||||
const QString URL_SCHEME_FTP = "ftp";
|
||||
const QString URL_SCHEME_ATP = "atp";
|
||||
|
||||
class ResourceManager {
|
||||
public:
|
||||
static ResourceRequest* createResourceRequest(QObject* parent, const QUrl& url);
|
||||
|
|
Loading…
Reference in a new issue