diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2009-07-15 10:40:53 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2009-07-17 11:36:17 (GMT) |
commit | 8ab072aff0527d3ef3e44cf1ceba7dca985a6f94 (patch) | |
tree | 6a7a77a5dcea90c00ebc66c735c19af731b042f3 /src/network/access/qhttpnetworkreply_p.h | |
parent | 430f93c3649aacea5d9ccab047f036027f0622ea (diff) | |
download | Qt-8ab072aff0527d3ef3e44cf1ceba7dca985a6f94.zip Qt-8ab072aff0527d3ef3e44cf1ceba7dca985a6f94.tar.gz Qt-8ab072aff0527d3ef3e44cf1ceba7dca985a6f94.tar.bz2 |
QNetworkAccessManager: HTTP download performance improvements
Better usage of move semantics with implicit sharing to avoid
detaching (=malloc/memcpy). Also some other improvements.
Download performance improvement is around 20% according
to the httpDownloadPerformance autotest.
Reviewed-by: Thiago Macieira
Diffstat (limited to 'src/network/access/qhttpnetworkreply_p.h')
-rw-r--r-- | src/network/access/qhttpnetworkreply_p.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h index 5eb70ce..fbbee12 100644 --- a/src/network/access/qhttpnetworkreply_p.h +++ b/src/network/access/qhttpnetworkreply_p.h @@ -80,6 +80,7 @@ static const unsigned char gz_magic[2] = {0x1f, 0x8b}; // gzip magic header #include <private/qhttpnetworkrequest_p.h> #include <private/qauthenticator_p.h> #include <private/qringbuffer_p.h> +#include <private/qbytedata_p.h> QT_BEGIN_NAMESPACE @@ -122,7 +123,6 @@ public: qint64 bytesAvailable() const; qint64 bytesAvailableNextBlock() const; - QByteArray read(qint64 maxSize = -1); QByteArray readAny(); bool isFinished() const; @@ -160,14 +160,14 @@ public: bool parseStatus(const QByteArray &status); qint64 readHeader(QAbstractSocket *socket); void parseHeader(const QByteArray &header); - qint64 readBody(QAbstractSocket *socket, QIODevice *out); - qint64 readBodyFast(QAbstractSocket *socket, QRingBuffer *rb); + qint64 readBody(QAbstractSocket *socket, QByteDataBuffer *out); + qint64 readBodyFast(QAbstractSocket *socket, QByteDataBuffer *rb); bool findChallenge(bool forProxy, QByteArray &challenge) const; QAuthenticatorPrivate::Method authenticationMethod(bool isProxy) const; void clear(); - qint64 readReplyBodyRaw(QIODevice *in, QIODevice *out, qint64 size); - qint64 readReplyBodyChunked(QIODevice *in, QIODevice *out); + qint64 readReplyBodyRaw(QIODevice *in, QByteDataBuffer *out, qint64 size); + qint64 readReplyBodyChunked(QIODevice *in, QByteDataBuffer *out); qint64 getChunkSize(QIODevice *in, qint64 *chunkSize); qint64 bytesAvailable() const; @@ -209,7 +209,7 @@ public: #endif bool autoDecompress; - QRingBuffer responseData; // uncompressed body + QByteDataBuffer responseData; // uncompressed body QByteArray compressedData; // compressed body (temporary) bool requestIsPrepared; }; |