summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorA-Team <ateam@pad.test.qt.nokia.com>2010-10-15 22:00:22 (GMT)
committerA-Team <ateam@pad.test.qt.nokia.com>2010-10-15 22:00:22 (GMT)
commit0b47cfe1163598bbc3e867073fb1b7c5b238fe73 (patch)
treecc5cf8846f8c9c670a2354070e47e0ad09f71cc0 /src/network
parente7b372e4705451dfd4443db7e6fc64d4b8f30c68 (diff)
parent4d9d3ed84c3bf1f6d08a9ddd36f834b9c8972b38 (diff)
downloadQt-0b47cfe1163598bbc3e867073fb1b7c5b238fe73.zip
Qt-0b47cfe1163598bbc3e867073fb1b7c5b238fe73.tar.gz
Qt-0b47cfe1163598bbc3e867073fb1b7c5b238fe73.tar.bz2
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp14
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp16
2 files changed, 28 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 6437f6f..d10f951 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -105,12 +105,22 @@ void QHttpNetworkConnectionChannel::init()
QObject::connect(socket, SIGNAL(readyRead()),
this, SLOT(_q_readyRead()),
Qt::DirectConnection);
+
+ // The disconnected() and error() signals may already come
+ // while calling connectToHost().
+ // In case of a cached hostname or an IP this
+ // will then emit a signal to the user of QNetworkReply
+ // but cannot be caught because the user did not have a chance yet
+ // to connect to QNetworkReply's signals.
+ qRegisterMetaType<QAbstractSocket::SocketError>("QAbstractSocket::SocketError");
QObject::connect(socket, SIGNAL(disconnected()),
this, SLOT(_q_disconnected()),
- Qt::DirectConnection);
+ Qt::QueuedConnection);
QObject::connect(socket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(_q_error(QAbstractSocket::SocketError)),
- Qt::DirectConnection);
+ Qt::QueuedConnection);
+
+
#ifndef QT_NO_NETWORKPROXY
QObject::connect(socket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
this, SLOT(_q_proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
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