summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-03-22 09:24:51 (GMT)
committeraxis <qt-info@nokia.com>2010-03-22 09:24:51 (GMT)
commite48850c6ec90cd5eaa95d07573c2afa1a1c4f67f (patch)
treec53fa338b532c986b4baa1b481e5406f2fa16b5a /src/network
parent390d7f64d9afa288fb2c01fc70eddc8b1f5ff585 (diff)
parent7491a2ecfdd0fe883c72d2ee60ca72393c2990d9 (diff)
downloadQt-e48850c6ec90cd5eaa95d07573c2afa1a1c4f67f.zip
Qt-e48850c6ec90cd5eaa95d07573c2afa1a1c4f67f.tar.gz
Qt-e48850c6ec90cd5eaa95d07573c2afa1a1c4f67f.tar.bz2
Merge branch '4.6-s60' into 4.7-s60
Conflicts: configure.exe mkspecs/common/symbian/symbian.conf src/gui/graphicsview/qgraphicswidget.h src/gui/kernel/qapplication.cpp src/gui/text/qtextlayout.cpp src/openvg/qpixmapdata_vg.cpp src/s60installs/s60installs.pro tools/runonphone/main.cpp tools/runonphone/serenum_unix.cpp qtextlayout.cpp fixed up together with Eskil. Kept the configure.exe from 4.7 without recompile.
Diffstat (limited to 'src/network')
-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);