qt6-bb10/tests/auto/network/access
Mårten Nordheim d9f80502f6 QNetworkDiskCache: Fix tracking of size during storeItem()
If the file already existed we simply removed the old one without
adjusting the size. So use the removeFile() function which takes care of
that.

Additionally, if the current size was non-null we previously increased
the size (presumably meant to be temporarily but wasn't) and called
expire() which would either:
1. not do anything and return currentCacheSize, if it was not greater
than the max size. This would mean that the size of the file would be
counted twice.
or,
2. discard currentCacheSize, measure the size of the items, and then
remove some items if the total size surpassed the max cache size

Neither of those branches need us to (temporarily) increase
currentCacheSize. It also doesn't attain the (presumed) goal of trying
to keep below the max cache size after having added the new item.

Fixes: QTBUG-95009
Pick-to: 6.2 6.1 5.15
Change-Id: I2b5b13ff473a7aa8169cf2aecfea783c97f2d09a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-07-20 18:30:44 +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 H2: emit encrypted for at least the first reply, similar to H1 2021-07-20 18:30:44 +02:00
qabstractnetworkcache Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qdecompresshelper QNetworkRequest: Rename (set)minimumArchiveBombSize 2021-07-02 13:05:32 +00: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 QNetworkRequest: Rename (set)minimumArchiveBombSize 2021-07-02 13:05:32 +00: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