diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-03-01 03:56:02 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-03-01 03:56:02 (GMT) |
commit | 9b54e9e7168cafd3885a0784dd24f74b8ad058ab (patch) | |
tree | 2464a4194ad9237494f5828a00321eadee1c1d4e /src/network/access/qhttpnetworkconnection.cpp | |
parent | 2c3cc70107d2a4ae32e092703dd6a7de734bee4a (diff) | |
parent | b1e097af8c0537794a64cfacd23848f8a2a7f0ca (diff) | |
download | Qt-9b54e9e7168cafd3885a0784dd24f74b8ad058ab.zip Qt-9b54e9e7168cafd3885a0784dd24f74b8ad058ab.tar.gz Qt-9b54e9e7168cafd3885a0784dd24f74b8ad058ab.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 18 |
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. |