summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hartmann <peter.hartmann@nokia.com>2011-04-04 10:31:37 (GMT)
committerPeter Hartmann <peter.hartmann@nokia.com>2011-04-04 11:49:02 (GMT)
commit939d2e725c2c52f33097fcc50664c46d40c05b04 (patch)
treec5af00c1ec85e67a1cf20f8c9392f4ad2f483eb7
parentc728783dc20cc2d4667affdefa19a4162a2ec9ef (diff)
downloadQt-939d2e725c2c52f33097fcc50664c46d40c05b04.zip
Qt-939d2e725c2c52f33097fcc50664c46d40c05b04.tar.gz
Qt-939d2e725c2c52f33097fcc50664c46d40c05b04.tar.bz2
HTTP backend: return earlier when resource loaded from cache
no need to add headers to the request if it is not sent but loaded from cache anyway. Reviewed-by: Markus Goetz
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index e75347f..fd20b2a 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -479,6 +479,13 @@ void QNetworkAccessHttpBackend::postRequest()
break; // can't happen
}
+ if (loadedFromCache) {
+ // commented this out since it will be called later anyway
+ // by copyFinished()
+ //QNetworkAccessBackend::finished();
+ return; // no need to send the request! :)
+ }
+
QList<QByteArray> headers = request().rawHeaderList();
if (resumeOffset != 0) {
if (headers.contains("Range")) {
@@ -506,13 +513,6 @@ void QNetworkAccessHttpBackend::postRequest()
foreach (const QByteArray &header, headers)
httpRequest.setHeaderField(header, request().rawHeader(header));
- if (loadedFromCache) {
- // commented this out since it will be called later anyway
- // by copyFinished()
- //QNetworkAccessBackend::finished();
- return; // no need to send the request! :)
- }
-
if (request().attribute(QNetworkRequest::HttpPipeliningAllowedAttribute).toBool() == true)
httpRequest.setPipeliningAllowed(true);