From aa52c26f094f2e109a96d32aad5d9e46f3fcfbd8 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 3 Oct 2011 16:27:34 +0100 Subject: QNAM - fix poor performance of HEAD request with authentication QHttpNetworkReply was waiting for a body to be sent for 401 and 407 responses, whereas with a HTTP HEAD request, there will be no body. This delayed the authentication signal until after the http channel is closed by the server after a timeout. For example with the server used for autotesting, the authentication signal is delayed 15 seconds. When the server has a very long timeout, the authentication signal may not be emitted at all. Task-Number: QT-5304 Reviewed-By: Martin Petersson (cherry picked from commit 8610ee14b8636641651a8ba6040cca16c4141ed6) Change-Id: Ie4ce6c598df86ce59910f793fd5ae7c1ccf39f9d Reviewed-on: http://codereview.qt-project.org/6032 Reviewed-by: Qt Sanity Bot Reviewed-by: Martin Petersson --- src/network/access/qhttpnetworkreply.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp index 5b174dbc05..e6d0d3238c 100644 --- a/src/network/access/qhttpnetworkreply.cpp +++ b/src/network/access/qhttpnetworkreply.cpp @@ -814,7 +814,7 @@ bool QHttpNetworkReplyPrivate::expectContent() || statusCode == 204 || statusCode == 304) return false; if (request.operation() == QHttpNetworkRequest::Head) - return !shouldEmitSignals(); + return false; // no body expected for HEAD request qint64 expectedContentLength = contentLength(); if (expectedContentLength == 0) return false; -- cgit v1.2.3