qt5base-lts/tests/auto/network/access
Mårten Nordheim b41d5f6293 QDecompressHelper: Skip double-decompression if download is small
To retain backwards compatibility with some QNetworkReply usage,
namely connecting solely to finished-signal and allocating a buffer to
read into, but without storing the entire decompressed file in memory
until read, we may decompress the file twice.

With this patch users can now avoid this double decompression if the
amount of buffered data stays below 10 MiB. This means any file smaller
than 10 MiB will never need to be decompressed twice to know the size of
it. On top of that, if the data is handled as it arrives (e.g. in
readyRead) and the buffer is kept below 10 MiB it won't need to
decompress twice either.

This is active as long as "countDecompressed" is true, though it
currently always is in QNetworkAccessManger, with a future goal to make
it possible to control with public API. Since it requires the user to
potentially adapt their usage of QNetworkReply.

In this patch we also stop tracking the amount of unhandled uncompressed
bytes (uncompressedBytes) in favor of tracking the total amount of bytes
which has been read() by the user of QDecompressHelper (totalBytesRead),
since we can more intuitively work out the total amount of unread bytes
using this value.

Change-Id: Ie3d8d6e39a18343fcf9b610f45c7fe7e4cd4e474
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-08-04 19:31:52 +02:00
..
hpack Remove the qmake project files 2021-01-07 15:32:28 +01:00
hsts Remove the qmake project files 2021-01-07 15:32:28 +01:00
http2 QNetworkReply: Add two new signals 2021-07-20 22:08:39 +02:00
qabstractnetworkcache Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qdecompresshelper QDecompressHelper: Skip double-decompression if download is small 2021-08-04 19:31:52 +02:00
qhttpnetworkconnection Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qhttpnetworkreply Remove the qmake project files 2021-01-07 15:32:28 +01:00
qnetworkaccessmanager Remove the qmake project files 2021-01-07 15:32:28 +01:00
qnetworkcachemetadata Remove the qmake project files 2021-01-07 15:32:28 +01:00
qnetworkcookie QNetworkCookie: Rename sameSite to sameSitePolicy 2021-04-14 13:44:26 +02:00
qnetworkcookiejar Update public suffix list to today's latest 2021-01-27 15:00:57 +01:00
qnetworkdiskcache QNetworkDiskCache: Fix tracking of size during storeItem() 2021-07-20 18:30:44 +02:00
qnetworkreply QNAM: Allow to configure when connections to a host are torn down 2021-07-27 17:16:58 +02:00
qnetworkrequest Remove the qmake project files 2021-01-07 15:32:28 +01:00
CMakeLists.txt Remove QFtp sources etc. in favor of alternate distribution 2020-08-27 18:58:21 +02:00