summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-18 08:21:08 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-18 08:21:08 (GMT)
commit603a8501e0e203ecd6075b19be3bccb11f16ee88 (patch)
tree9dd9469f2d268aa5a3da4aa424b98b84fece3c28 /src
parentbc24cc06232effe5267d24d27950bcfcab232b31 (diff)
parent49fb6772638873d801166b806e4bb36ddde4cb50 (diff)
downloadQt-603a8501e0e203ecd6075b19be3bccb11f16ee88.zip
Qt-603a8501e0e203ecd6075b19be3bccb11f16ee88.tar.gz
Qt-603a8501e0e203ecd6075b19be3bccb11f16ee88.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QNAM HTTP: Fix no-headers and HTTP-100 handling
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp1
-rw-r--r--src/network/access/qhttpnetworkreply.cpp19
-rw-r--r--src/network/access/qhttpnetworkreply_p.h1
3 files changed, 17 insertions, 4 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 806452c..1d8224c 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -353,6 +353,7 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
replyPrivate->autoDecompress = false;
}
if (replyPrivate->statusCode == 100) {
+ replyPrivate->clearHttpLayerInformation();
replyPrivate->state = QHttpNetworkReplyPrivate::ReadingStatusState;
break; // ignore
}
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index 984f557..338236e 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -219,7 +219,7 @@ QHttpNetworkReplyPrivate::~QHttpNetworkReplyPrivate()
{
}
-void QHttpNetworkReplyPrivate::clear()
+void QHttpNetworkReplyPrivate::clearHttpLayerInformation()
{
state = NothingDoneState;
statusCode = 100;
@@ -229,18 +229,24 @@ void QHttpNetworkReplyPrivate::clear()
currentChunkSize = 0;
currentChunkRead = 0;
connectionCloseEnabled = true;
- connection = 0;
- connectionChannel = 0;
#ifndef QT_NO_COMPRESS
if (initInflate)
inflateEnd(&inflateStrm);
#endif
initInflate = false;
streamEnd = false;
- autoDecompress = false;
fields.clear();
}
+// TODO: Isn't everything HTTP layer related? We don't need to set connection and connectionChannel to 0 at all
+void QHttpNetworkReplyPrivate::clear()
+{
+ connection = 0;
+ connectionChannel = 0;
+ autoDecompress = false;
+ clearHttpLayerInformation();
+}
+
// QHttpNetworkReplyPrivate
qint64 QHttpNetworkReplyPrivate::bytesAvailable() const
{
@@ -539,6 +545,11 @@ qint64 QHttpNetworkReplyPrivate::readHeader(QAbstractSocket *socket)
|| fragment.endsWith("\r\n\n")
|| fragment.endsWith("\n\n"))
allHeaders = true;
+
+ // there is another case: We have no headers. Then the fragment equals just the line ending
+ if ((fragment.length() == 2 && fragment.endsWith("\r\n"))
+ || (fragment.length() == 1 && fragment.endsWith("\n")))
+ allHeaders = true;
}
}
} while (!allHeaders && haveRead > 0);
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h
index fa240ec..4011c78 100644
--- a/src/network/access/qhttpnetworkreply_p.h
+++ b/src/network/access/qhttpnetworkreply_p.h
@@ -172,6 +172,7 @@ public:
bool findChallenge(bool forProxy, QByteArray &challenge) const;
QAuthenticatorPrivate::Method authenticationMethod(bool isProxy) const;
void clear();
+ void clearHttpLayerInformation();
qint64 readReplyBodyRaw(QIODevice *in, QByteDataBuffer *out, qint64 size);
qint64 readReplyBodyChunked(QIODevice *in, QByteDataBuffer *out);