diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2010-02-09 08:58:22 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2010-02-09 09:19:17 (GMT) |
commit | 94630819258edef96c434add7bbd4b1b425ea71a (patch) | |
tree | 9d8477ec7701f90d54cd760c9a96c3ce63fd609b /src/network/access | |
parent | 91687be5b61ffd7e7239e6a17008aefe82ac1093 (diff) | |
download | Qt-94630819258edef96c434add7bbd4b1b425ea71a.zip Qt-94630819258edef96c434add7bbd4b1b425ea71a.tar.gz Qt-94630819258edef96c434add7bbd4b1b425ea71a.tar.bz2 |
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
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 7 |
1 files 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 |