diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2009-08-04 14:16:32 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2009-08-04 14:18:21 (GMT) |
commit | 627c5c865d77cca1f0d6508f8facfe6c0bf4d363 (patch) | |
tree | 0268a4abebf1cf8ddf571c4b6912dbabcf27fa06 /src/network/access/qhttpnetworkreply.cpp | |
parent | df373516909d4dc0dfe8149f4cbff17c9c9bfe54 (diff) | |
download | Qt-627c5c865d77cca1f0d6508f8facfe6c0bf4d363.zip Qt-627c5c865d77cca1f0d6508f8facfe6c0bf4d363.tar.gz Qt-627c5c865d77cca1f0d6508f8facfe6c0bf4d363.tar.bz2 |
QNAM HTTP Code: Moved append() functions to the reply object
Reviewed-by: TrustMe
Diffstat (limited to 'src/network/access/qhttpnetworkreply.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkreply.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp index a623999..f40f7bf 100644 --- a/src/network/access/qhttpnetworkreply.cpp +++ b/src/network/access/qhttpnetworkreply.cpp @@ -687,6 +687,36 @@ qint64 QHttpNetworkReplyPrivate::getChunkSize(QIODevice *in, qint64 *chunkSize) return bytes; } +void QHttpNetworkReplyPrivate::appendUncompressedReplyData(QByteArray &qba) +{ + responseData.append(qba); + + // clear the original! helps with implicit sharing and + // avoiding memcpy when the user is reading the data + qba.clear(); +} + +void QHttpNetworkReplyPrivate::appendUncompressedReplyData(QByteDataBuffer &data) +{ + responseData.append(data); + + // clear the original! helps with implicit sharing and + // avoiding memcpy when the user is reading the data + data.clear(); +} + +void QHttpNetworkReplyPrivate::appendCompressedReplyData(QByteDataBuffer &data) +{ + // Work in progress: Later we will directly use a list of QByteArray or a QRingBuffer + // instead of one QByteArray. + for(int i = 0; i < data.bufferCount(); i++) { + QByteArray &byteData = data[i]; + compressedData.append(byteData.constData(), byteData.size()); + } + data.clear(); +} + + // SSL support below #ifndef QT_NO_OPENSSL |