summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-10-14 13:46:22 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-10-14 14:17:45 (GMT)
commitc089696d8de41762a1e8abb067b2721ce3de4d27 (patch)
tree6f4eefbf743e3dcb482535b8c1ca295f8ef8c69a /src/network/access
parentf38e8394eae20f7290688629ab66720ebacd64c9 (diff)
downloadQt-c089696d8de41762a1e8abb067b2721ce3de4d27.zip
Qt-c089696d8de41762a1e8abb067b2721ce3de4d27.tar.gz
Qt-c089696d8de41762a1e8abb067b2721ce3de4d27.tar.bz2
QNAM: Do not need QNetworkSession for data://
This was already fixed in 4.8, this is a hotfix for 4.7 Task-Number: QT-4096 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Diffstat (limited to 'src/network/access')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index a637474..12fe094 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -944,6 +944,22 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
{
Q_D(QNetworkAccessManager);
+ // 4.7 only hotfix fast path for data:// URLs
+ // In 4.8 this is solved with QNetworkReplyDataImpl and will work there
+ // This hotfix is done for not needing a QNetworkSession for data://
+ if ((op == QNetworkAccessManager::GetOperation || op == QNetworkAccessManager::HeadOperation)
+ && (req.url().scheme() == QLatin1String("data"))) {
+ QNetworkReplyImpl *reply = new QNetworkReplyImpl(this);
+ QNetworkReplyImplPrivate *priv = reply->d_func();
+ priv->manager = this;
+ priv->backend = new QNetworkAccessDataBackend();
+ priv->backend->manager = this->d_func();
+ priv->backend->setParent(reply);
+ priv->backend->reply = priv;
+ priv->setup(op, req, outgoingData);
+ return reply;
+ }
+
// fast path for GET on file:// URLs
// Also if the scheme is empty we consider it a file.
// The QNetworkAccessFileBackend will right now only be used for PUT