diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-05-13 11:58:08 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-05-13 11:58:08 (GMT) |
commit | 0a74bc2ce91e8c7a10ae54fd0f80814902fa5de9 (patch) | |
tree | 046ad0fdf693107efb75a0ecd03f6cbc3dd00680 /src/network/access/qhttpnetworkconnection.cpp | |
parent | c2c69c117407990e5c2d8900f4aa27979273084a (diff) | |
parent | a18ebd2a70e83863bc9a8cc64a65791a6d879f02 (diff) | |
download | Qt-0a74bc2ce91e8c7a10ae54fd0f80814902fa5de9.zip Qt-0a74bc2ce91e8c7a10ae54fd0f80814902fa5de9.tar.gz Qt-0a74bc2ce91e8c7a10ae54fd0f80814902fa5de9.tar.bz2 |
Merge branch '4.5'
Conflicts:
tests/auto/qgraphicsview/tst_qgraphicsview.cpp
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index af0ac84..d4bf008 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -586,10 +586,20 @@ void QHttpNetworkConnectionPrivate::receiveReply(QAbstractSocket *socket, QHttpN QHttpNetworkReplyPrivate::ReplyState state = reply ? reply->d_func()->state : QHttpNetworkReplyPrivate::AllDoneState; switch (state) { case QHttpNetworkReplyPrivate::NothingDoneState: - case QHttpNetworkReplyPrivate::ReadingStatusState: - bytes += reply->d_func()->readStatus(socket); + case QHttpNetworkReplyPrivate::ReadingStatusState: { + qint64 statusBytes = reply->d_func()->readStatus(socket); + if (statusBytes == -1) { + // error reading the status, close the socket and emit error + socket->close(); + reply->d_func()->errorString = errorDetail(QNetworkReply::ProtocolFailure, socket); + emit reply->finishedWithError(QNetworkReply::ProtocolFailure, reply->d_func()->errorString); + QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); + break; + } + bytes += statusBytes; channels[i].lastStatus = reply->d_func()->statusCode; break; + } case QHttpNetworkReplyPrivate::ReadingHeaderState: bytes += reply->d_func()->readHeader(socket); if (reply->d_func()->state == QHttpNetworkReplyPrivate::ReadingDataState) { |