From 94630819258edef96c434add7bbd4b1b425ea71a Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 9 Feb 2010 09:58:22 +0100 Subject: QNAM HTTP: Fix issue with some servers The call to eatWhitespace() must only be done before reading the status, not while reading it. (We can be in ReadingStatusState for multiple loop iterations) Task-number: QTBUG-7673 Reviewed-by: Peter Hartmann --- src/network/access/qhttpnetworkconnectionchannel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 70a301d..5bd972c 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -305,9 +305,12 @@ void QHttpNetworkConnectionChannel::_q_receiveReply() while (socket->bytesAvailable()) { QHttpNetworkReplyPrivate::ReplyState state = reply ? reply->d_func()->state : QHttpNetworkReplyPrivate::AllDoneState; switch (state) { - case QHttpNetworkReplyPrivate::NothingDoneState: - case QHttpNetworkReplyPrivate::ReadingStatusState: { + case QHttpNetworkReplyPrivate::NothingDoneState: { + // only eat whitespace on the first call eatWhitespace(); + state = reply->d_func()->state = QHttpNetworkReplyPrivate::ReadingStatusState; + } + case QHttpNetworkReplyPrivate::ReadingStatusState: { qint64 statusBytes = reply->d_func()->readStatus(socket); if (statusBytes == -1 && reconnectAttempts <= 0) { // too many errors reading/receiving/parsing the status, close the socket and emit error -- cgit v0.12