summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-02-24 10:35:29 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-02-24 12:42:01 (GMT)
commit997dc8bdfc927bc730a04dad5b88f46dab6eeaba (patch)
treed07c6221db23d683c4137259ce493a948a5cce01 /src/network
parentf6293eaf8c2f3d211441f1011d7dd8c88e3d81ef (diff)
downloadQt-997dc8bdfc927bc730a04dad5b88f46dab6eeaba.zip
Qt-997dc8bdfc927bc730a04dad5b88f46dab6eeaba.tar.gz
Qt-997dc8bdfc927bc730a04dad5b88f46dab6eeaba.tar.bz2
QNAM HTTP: Switch back to QueuedConnection for requeueRequest.
Reviewed-by: Peter Hartmann
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp18
1 files changed, 16 insertions, 2 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.