Disable request limiting for ATP requests in ResourceCache

This commit is contained in:
Ryan Huffman 2015-08-27 13:57:00 -07:00
parent 12d3cf557a
commit b401a62d7f
3 changed files with 14 additions and 8 deletions

View file

@ -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;

View file

@ -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) {

View 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);