summaryrefslogtreecommitdiffstats
path: root/src/network/access/qdecompresshelper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QNetworkRequest: Rename (set)minimumArchiveBombSizeMårten Nordheim2021-07-021-5/+5
| | | | | | | | | To (set)decompressedSafetyCheckThreshold, as suggested on the API review. Task-number: QTBUG-94407 Change-Id: Iffc52691022939ae46703de8a0416355487b716f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkRequest: Add API to set a minimum archive bomb sizeMårten Nordheim2021-05-311-16/+12
| | | | | | Fixes: QTBUG-91870 Change-Id: Ia23e8b8bcfdf65a91fe57e739242a355c681c9e6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make qdecompresshelper archive bomb check only trigger for large filesØystein Heskestad2021-03-051-0/+8
| | | | | | | | | | | | This is to avoid false positives. By default files are large if uncompressed size > 10 MB. Only configurable internally. Also add auto tests. Task-number: QTBUG-91392 Pick-to: 6.0 6.1 Change-Id: I32258cb7c957f2a23a05157ba4ed5c0af2ba585e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDecompressHelper: use the new readPointer function in QByteDataBufferMårten Nordheim2020-11-061-43/+29
| | | | | | | | | | Gets rid of moving strings back and forth, which was extra expensive without QList's prepend optimization (which is returning, but getting rid of the moves is even better). Change-Id: I520fc140310a0e1f096dda97f2e999d0e7993e77 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDecompressHelper: limit decompression ratioMårten Nordheim2020-09-221-0/+57
| | | | | | | | To avoid potential decompression bombs. This is implemented with just a simple check that the ratio doesn't pass some hardcoded preset. Change-Id: I17246f0f43e73280cdb35a8f03d65885f5678ad6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDecompressHelper: Fix warnings in zstd codeMårten Nordheim2020-08-171-4/+1
| | | | | | | | | | | | | One warning about unused variable (dataLeftover), which was at some point replaced by the class variable 'decoderHasData'. The second warning was a fault of logic: checking that the unsigned value retValue was greater than or equal to zero. Which only came about because they initially did different things but the branches got merged and the logic became flawed. Change-Id: Ia3a04516c1b7b5f962226998bf3f4d101dd38148 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QDecompressHelper: Introduce zstd supportMårten Nordheim2020-08-141-2/+80
| | | | | | | | | Also take this opportunity to reshuffle the content-encodings in the intended ordering since the ordering is used to signify priority. Task-number: QTBUG-83269 Change-Id: I022eecf1ba03b54dbd9c98a9d63d05fb05fd2124 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDecompressHelper: Change order of encodingsUlf Hermann2020-08-121-1/+1
| | | | | | | | | Before the introduction of QDecompressHelper gzip was preferred over deflate. The change seems to be accidental. Amends commit 7b76379a89158f10780cbfc74965027246faec68. Change-Id: I70f33d551912465d63f49ea3db1ac3575d19a92d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDecompressHelper: Add brotli supportMårten Nordheim2020-08-061-0/+115
| | | | | | Task-number: QTBUG-83269 Change-Id: If23b098ee76a4892e4c2c6ce5c635688d8d9138d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Make use of QDecompressHelper for HTTP downloadsMårten Nordheim2020-08-051-0/+13
| | | | | | | | | | 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>
* Privately introducing QDecompressHelper for network purposesMårten Nordheim2020-08-051-0/+479
To support streaming decompression in QNAM. Will also be used to refactor existing decompression code in QNAM. Task-number: QTBUG-83269 Change-Id: Iecf3e359734163f15686c949f75d41fa4794a00e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>