diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2020-05-07 17:34:22 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2020-08-05 17:19:10 +0200 |
commit | 7b76379a89158f10780cbfc74965027246faec68 (patch) | |
tree | d289667ca662d538cb768126c8ed076b7e8e4dfc /src/network/access/qhttpnetworkreply_p.h | |
parent | 7ec0786d78c7420244d488553d7d10eee4fe60b2 (diff) |
Make use of QDecompressHelper for HTTP downloads
Changes are not too big for now. Just replaces use of the previous
calls to the zlib decompression function. And initialize
QDecompressHelper when we know the content-encoding.
Task-number: QTBUG-83269
Change-Id: I41358feaef2e7ac5f48f14e3f95ec094e0c110b7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/access/qhttpnetworkreply_p.h')
-rw-r--r-- | src/network/access/qhttpnetworkreply_p.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h index f8b45a8adc..7a23d310cc 100644 --- a/src/network/access/qhttpnetworkreply_p.h +++ b/src/network/access/qhttpnetworkreply_p.h @@ -55,10 +55,6 @@ #include <qplatformdefs.h> -#ifndef QT_NO_COMPRESS -struct z_stream_s; -#endif - #include <QtNetwork/qtcpsocket.h> // it's safe to include these even if SSL support is not enabled #include <QtNetwork/qsslsocket.h> @@ -80,6 +76,8 @@ Q_MOC_INCLUDE(<QtNetwork/QNetworkProxy>) #endif Q_MOC_INCLUDE(<QtNetwork/QAuthenticator>) +#include <private/qdecompresshelper_p.h> + QT_REQUIRE_CONFIG(http); QT_BEGIN_NAMESPACE @@ -157,6 +155,8 @@ public: static bool isHttpRedirect(int statusCode); + bool isCompressed() const; + #ifndef QT_NO_SSL QSslConfiguration sslConfiguration() const; void setSslConfiguration(const QSslConfiguration &config); @@ -224,7 +224,7 @@ public: bool isChunked(); bool isConnectionCloseEnabled(); - bool isCompressed(); + bool isCompressed() const; void removeAutoDecompressHeader(); enum ReplyState { @@ -276,11 +276,7 @@ public: char* userProvidedDownloadBuffer; QUrl redirectUrl; -#ifndef QT_NO_COMPRESS - z_stream_s *inflateStrm; - int initializeInflateStream(); - qint64 uncompressBodyData(QByteDataBuffer *in, QByteDataBuffer *out); -#endif + QDecompressHelper decompressHelper; }; |