summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-26 15:04:38 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-26 15:04:38 (GMT)
commitca82ee4ee55e52c75326949148455af1095df014 (patch)
tree8266295822f50094ff49fd60dc5ac70f075925f2 /src/network/access
parent27e403d9c6185c606980bb7881e39a2c88138a13 (diff)
parentb78012c855a8b00fa0d100cd0cf6c8de024dfa69 (diff)
downloadQt-ca82ee4ee55e52c75326949148455af1095df014.zip
Qt-ca82ee4ee55e52c75326949148455af1095df014.tar.gz
Qt-ca82ee4ee55e52c75326949148455af1095df014.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public: (81 commits) Added addMMPRules for adding conditional MMP_RULES Allow overriding TARGET.EPOCHEAPSIZE with MMP_RULES Build break fix for commit d8465414e6fd543cfc20e732030dedd8d2bc685f. Fix for cetest. Speed up compilation of this test with MSVC. New benchmark for QDirIterator Backporting auto-test utility header from master. Fix a signed/unsigned comparison compiler warning Removed an export that shouldn't be exported. Reduced the code and memory footprint of the keymap. Enabled Qt key events to work also when native key code is missing. Cleaning of the patch to QTBUG-3168 Patch to QTBUG-3168 Crash in QGraphicsScenePrivate::setFocusItemHelper Pass the right arguments to QApplication in GraphicsView benchmark. Improvements to itemview keypad navigation in S60. Revert changes made in scroll_sys(). Fix SymbianMakefileGenerator::absolutizePath for clean builds Set the roleNames of proxy models to the roleNames of the source model. Add benchmarks for accessing meta-object properties via QScriptValue ...
Diffstat (limited to 'src/network/access')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp18
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp2
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp9
-rw-r--r--src/network/access/qnetworkrequest.cpp2
4 files changed, 28 insertions, 3 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 62aa2d7..a887449 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -416,13 +416,25 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
lowPriorityQueue.prepend(pair);
break;
}
+
// this used to be called via invokeMethod and a QueuedConnection
+ // It is the only place _q_startNextRequest is called directly without going
+ // through the event loop using a QueuedConnection.
+ // This is dangerous because of recursion that might occur when emitting
+ // signals as DirectConnection from this code path. Therefore all signal
+ // emissions that can come out from this code path need to
+ // be QueuedConnection.
+ // We are currently trying to fine-tune this.
_q_startNextRequest();
+
+
return reply;
}
void QHttpNetworkConnectionPrivate::requeueRequest(const HttpMessagePair &pair)
{
+ Q_Q(QHttpNetworkConnection);
+
QHttpNetworkRequest request = pair.first;
switch (request.priority()) {
case QHttpNetworkRequest::HighPriority:
@@ -433,8 +445,8 @@ void QHttpNetworkConnectionPrivate::requeueRequest(const HttpMessagePair &pair)
lowPriorityQueue.prepend(pair);
break;
}
- // this used to be called via invokeMethod and a QueuedConnection
- _q_startNextRequest();
+
+ QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);
}
void QHttpNetworkConnectionPrivate::dequeueAndSendRequest(QAbstractSocket *socket)
@@ -682,6 +694,8 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply)
+// This function must be called from the event loop. The only
+// exception is documented in QHttpNetworkConnectionPrivate::queueRequest
void QHttpNetworkConnectionPrivate::_q_startNextRequest()
{
//resend the necessary ones.
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index dbee72a..e92b2f3 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -459,6 +459,8 @@ void QHttpNetworkConnectionChannel::handleUnexpectedEOF()
} else {
reconnectAttempts--;
reply->d_func()->clear();
+ reply->d_func()->connection = connection;
+ reply->d_func()->connectionChannel = this;
closeAndResendCurrentRequest();
}
}
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index b9bd52a..5876ee2 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -110,7 +110,8 @@ static void ensureInitialized()
object, which holds the common configuration and settings for the requests
it sends. It contains the proxy and cache configuration, as well as the
signals related to such issues, and reply signals that can be used to
- monitor the progress of a network operation.
+ monitor the progress of a network operation. One QNetworkAccessManager
+ should be enough for the whole Qt application.
Once a QNetworkAccessManager object has been created, the application can
use it to send requests over the network. A group of standard functions
@@ -121,6 +122,7 @@ static void ensureInitialized()
A simple download off the network could be accomplished with:
\snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 0
+ QNetworkAccessManager has an asynchronous API.
When the \tt replyFinished slot above is called, the parameter it
takes is the QNetworkReply object containing the downloaded data
as well as meta-data (headers, etc.).
@@ -130,6 +132,11 @@ static void ensureInitialized()
delete it inside the slot connected to finished(). You can use the
deleteLater() function.
+ \note QNetworkAccessManager queues the requests it receives. The number
+ of requests executed in parallel is dependent on the protocol.
+ Currently, for the HTTP protocol on desktop platforms, 6 requests are
+ executed in parallel for one host/port combination.
+
A more involved example, assuming the manager is already existent,
can be:
\snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 1
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index e563f4e..61c116d 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -138,6 +138,8 @@ QT_BEGIN_NAMESPACE
default follow redirections: it's up to the application to
determine if the requested redirection should be allowed,
according to its security policies.
+ The returned URL might be relative. Use QUrl::resolved()
+ to create an absolute URL out of it.
\value ConnectionEncryptedAttribute
Replies only, type: QVariant::Bool (default: false)