From 8ff968cc37c34121dc6a458df0d4d39850a54bff Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Fri, 28 Aug 2009 10:11:57 +0200 Subject: QNAM HTTP Code: HTTP/1.0 has implicit connection close Reviewed-by: TrustMe --- src/network/access/qhttpnetworkreply.cpp | 7 +++++-- 1 file 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; } -- cgit v0.12