summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2009-08-17 14:15:18 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2009-08-20 08:52:37 (GMT)
commit67376be28ca51930ff0f4fad2dd58f53968655a9 (patch)
tree06da6fb0a834d3cbd70147098476f32d06cbd48b /demos
parent09138f1f4eb45c196506ab94a455dc47cec3575a (diff)
downloadQt-67376be28ca51930ff0f4fad2dd58f53968655a9.zip
Qt-67376be28ca51930ff0f4fad2dd58f53968655a9.tar.gz
Qt-67376be28ca51930ff0f4fad2dd58f53968655a9.tar.bz2
QNAM HTTP Pipelining
HTTP Pipelining should improve the performance of HTTP requests for high latency network links. Since some servers/proxies could have problems with it, it is disabled by default. Set the HttpPipeliningAllowed attribute of a QNetworkRequest to enable it for that request. Reviewed-by: Thiago
Diffstat (limited to 'demos')
-rw-r--r--demos/browser/networkaccessmanager.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/demos/browser/networkaccessmanager.h b/demos/browser/networkaccessmanager.h
index 381cb50..4c4603e 100644
--- a/demos/browser/networkaccessmanager.h
+++ b/demos/browser/networkaccessmanager.h
@@ -43,6 +43,7 @@
#define NETWORKACCESSMANAGER_H
#include <QtNetwork/QNetworkAccessManager>
+#include <QtNetwork/QNetworkRequest>
class NetworkAccessManager : public QNetworkAccessManager
{
@@ -51,6 +52,14 @@ class NetworkAccessManager : public QNetworkAccessManager
public:
NetworkAccessManager(QObject *parent = 0);
+ // this is a temporary hack until we properly use the pipelining flags from QtWebkit
+ // pipeline everything! :)
+ virtual QNetworkReply* createRequest ( Operation op, const QNetworkRequest & req, QIODevice * outgoingData = 0 ) {
+ QNetworkRequest request = req; // copy so we can modify
+ request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
+ return QNetworkAccessManager::createRequest(op, request, outgoingData);
+ }
+
private:
QList<QString> sslTrustedHostList;