summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2009-08-28 08:11:57 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2009-08-28 08:13:08 (GMT)
commit8ff968cc37c34121dc6a458df0d4d39850a54bff (patch)
tree1631e30bd7a2dd71f48500b18910dacaab97fbac /src/network/access
parentaae9ae9dc5de983a7605934b13113abc647683c4 (diff)
downloadQt-8ff968cc37c34121dc6a458df0d4d39850a54bff.zip
Qt-8ff968cc37c34121dc6a458df0d4d39850a54bff.tar.gz
Qt-8ff968cc37c34121dc6a458df0d4d39850a54bff.tar.bz2
QNAM HTTP Code: HTTP/1.0 has implicit connection close
Reviewed-by: TrustMe
Diffstat (limited to 'src/network/access')
-rw-r--r--src/network/access/qhttpnetworkreply.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index d3d57d4..ea2018d 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -514,8 +514,11 @@ qint64 QHttpNetworkReplyPrivate::readHeader(QAbstractSocket *socket)
chunkedTransferEncoding = headerField("transfer-encoding").toLower().contains("chunked");
// cache isConnectionCloseEnabled since it is called often
- connectionCloseEnabled = (headerField("connection").toLower().contains("close") ||
- headerField("proxy-connection").toLower().contains("close"));
+ QByteArray connectionHeaderField = headerField("connection");
+ // check for explicit indication of close or the implicit connection close of HTTP/1.0
+ connectionCloseEnabled = (connectionHeaderField.toLower().contains("close") ||
+ headerField("proxy-connection").toLower().contains("close")) ||
+ (majorVersion == 1 && minorVersion == 0 && connectionHeaderField.isEmpty());
}
return bytes;
}