summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-04-21 14:40:42 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-04-21 14:40:42 (GMT)
commit7807d804c85b0978cd3e1e3325abbd16dabd2ae0 (patch)
tree558c75b2b7f1f101a0e472b6ad6f808b3d2c06aa /src/network
parentc74dac2a0ef5d1b428c4da4e48fab05f9886233a (diff)
parentc24bff633684b99d05e28bd4926e557fb553cf75 (diff)
downloadQt-7807d804c85b0978cd3e1e3325abbd16dabd2ae0.zip
Qt-7807d804c85b0978cd3e1e3325abbd16dabd2ae0.tar.gz
Qt-7807d804c85b0978cd3e1e3325abbd16dabd2ae0.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: src/openvg/qpaintengine_vg.cpp src/script/bridge/qscriptqobject_p.h tests/auto/bic/tst_bic.cpp
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp6
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp2
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp5
-rw-r--r--src/network/kernel/qhostinfo.cpp6
-rw-r--r--src/network/socket/qabstractsocket.cpp4
5 files changed, 17 insertions, 6 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index a6322a3..559124f 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -489,7 +489,11 @@ void QHttpNetworkConnectionPrivate::fillPipeline(QAbstractSocket *socket)
int i = indexOf(socket);
- if (! (defaultPipelineLength - channels[i].alreadyPipelinedRequests.length() >= 2)) {
+ // return fast if there was no reply right now processed
+ if (channels[i].reply == 0)
+ return;
+
+ if (! (defaultPipelineLength - channels[i].alreadyPipelinedRequests.length() >= defaultRePipelineLength)) {
return;
}
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index f9a6de8..57d995a 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -384,7 +384,7 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
if (!replyPrivate->expectContent()) {
replyPrivate->state = QHttpNetworkReplyPrivate::AllDoneState;
allDone();
- return;
+ break;
}
}
break;
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index c3dc168..07a5bf3 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -689,8 +689,13 @@ QNetworkReplyImpl::QNetworkReplyImpl(QObject *parent)
QNetworkReplyImpl::~QNetworkReplyImpl()
{
Q_D(QNetworkReplyImpl);
+
+ // This code removes the data from the cache if it was prematurely aborted.
+ // See QNetworkReplyImplPrivate::completeCacheSave(), we disable caching there after the cache
+ // save had been properly finished. So if it is still enabled it means we got deleted/aborted.
if (d->isCachingEnabled())
d->networkCache()->remove(url());
+
if (d->outgoingDataBuffer)
delete d->outgoingDataBuffer;
}
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index baf69e7..73f8186 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -551,13 +551,11 @@ void QHostInfoLookupManager::work()
}
}
- if (scheduled && threadPool.tryStart(scheduled)) {
+ if (scheduled && currentLookups.size() < threadPool.maxThreadCount()) {
// runnable now running in new thread, track this in currentLookups
+ threadPool.start(scheduled);
iterator.remove();
currentLookups.append(scheduled);
- } else if (scheduled) {
- // wanted to start, but could not because thread pool is busy
- break;
} else {
// was postponed, continue iterating
continue;
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 21cd0fd..b604e89 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -2382,6 +2382,10 @@ void QAbstractSocket::disconnectFromHostImplementation()
#if defined(QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocket::disconnectFromHost() aborting immediately");
#endif
+ if (d->state == HostLookupState) {
+ QHostInfo::abortHostLookup(d->hostLookupId);
+ d->hostLookupId = -1;
+ }
} else {
// Perhaps emit closing()
if (d->state != ClosingState) {