summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-04-11 23:01:43 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-11 23:01:43 +0200
commit4c1e15548a288455a5a62dcefacd7c9a44736346 (patch)
tree0273cad922b92b008870808fb67403131383313e /src/network/access
parentc501eb8bece9c9de37f7f0839a8396fbfa697fec (diff)
parent98d3e40fb7c88b670a93e73dace2d0f05a5f903c (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/network/access')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp27
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp3
2 files changed, 17 insertions, 13 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index fb40958178..169124e9f4 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -873,18 +873,23 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
if (!connection->d_func()->shouldEmitChannelError(socket))
return;
- // Need to dequeu the request so that we can emit the error.
- if (!reply)
- connection->d_func()->dequeueRequest(socket);
- if (reply) {
- reply->d_func()->errorString = errorString;
- emit reply->finishedWithError(errorCode, errorString);
- reply = 0;
- if (protocolHandler)
- protocolHandler->setReply(0);
- }
+ // emit error for all waiting replies
+ do {
+ // Need to dequeu the request so that we can emit the error.
+ if (!reply)
+ connection->d_func()->dequeueRequest(socket);
+
+ if (reply) {
+ reply->d_func()->errorString = errorString;
+ emit reply->finishedWithError(errorCode, errorString);
+ reply = 0;
+ if (protocolHandler)
+ protocolHandler->setReply(0);
+ }
+ } while (!connection->d_func()->highPriorityQueue.isEmpty()
+ || !connection->d_func()->lowPriorityQueue.isEmpty());
#ifndef QT_NO_SSL
- else if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY) {
+ if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY) {
QList<HttpMessagePair> spdyPairs = spdyRequestsToSend.values();
for (int a = 0; a < spdyPairs.count(); ++a) {
// emit error for all replies
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index bf49b97b30..f56c77505a 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -560,8 +560,7 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h
if (!expirationDate.isValid()) {
if (lastModified.isValid()) {
int diff = currentDateTime.secsTo(lastModified);
- expirationDate = lastModified;
- expirationDate.addSecs(diff / 10);
+ expirationDate = lastModified.addSecs(diff / 10);
if (httpRequest.headerField("Warning").isEmpty()) {
QDateTime dt;
dt.setTime_t(current_age);