summaryrefslogtreecommitdiffstats
path: root/src/network/access
Commit message (Collapse)AuthorAgeFilesLines
* Move QNAM's http header parsing into separate classØystein Heskestad2021-09-0910-131/+417
| | | | | | Fixes: QTBUG-80701 Change-Id: I43f5e102c15d121dba74e07e3cd4bb8aded1c763 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Fix documentation warnings for Qt NetworkTopi Reinio2021-09-081-3/+3
| | | | | | | | | | | | | | | | The Clang compiler used in QDoc complained about the documentation- specific overload of QAbstractSocket::bind(): error: incomplete type 'QHostAddress' named in nested name specifier Also, fix an attempted snippet inclusion to use the \include command, and fix the comment tag spacing and indentation. Pick-to: 6.2 Fixes: QTBUG-96293 Change-Id: Ie4d78933fa7ac0aaf7f3bcc6487e7fd823db5123 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Remove QNetworkAccessCache::Node's explicit ctorMårten Nordheim2021-09-071-8/+4
| | | | | Change-Id: I2a993bcf96a0c603496e8a420251a7e01f46acee Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* wasm: fix network data URI schemeLorn Potter2021-09-071-2/+0
| | | | | | | | | | Inadvertantly ifdefed out. Tested and works fine Fixes: QTBUG-96170 Pick-to: 6.2 5.15 Change-Id: Ib26cf76a548146d4212c48b228965348038f34e8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QNetworkAccessCache: Style fixes and move assertsMårten Nordheim2021-09-021-6/+4
| | | | | Change-Id: I300d2525d9987737697e2cc6a326be19554902c8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessCache: Port to QDeadlineTimerMårten Nordheim2021-09-021-13/+11
| | | | | | | | | QDeadlineTimer is semantically more correct than comparing timestamps to 'now'. Change-Id: I15d9654af2886499392e6409d22f802203aca18d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkAccessCache: move debug logging to specific ifdefMårten Nordheim2021-09-021-1/+3
| | | | | | | | | | | | Instead of for any debug output. Since QTestLib cuts off output after X messages we shouldn't add these by default. Another option would be categorized logging, but QNAC should not be very interesting for 'outside' users Change-Id: I4c2c2a68ca4962476bfecd679f3229ccf3403aee Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessCache: Remove the ctor and init member variables in classMårten Nordheim2021-09-022-8/+2
| | | | | | Change-Id: Ic7ce41679d89b496413ef13e6e917bf506b2405d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkAccessCache: Rename first and last nodeMårten Nordheim2021-09-022-64/+68
| | | | | | | | | | | | | 'oldest' and 'newest' to me make me thing of 'least recently inserted' and 'most recently inserted', which is what they used to mean. But now the expiration can be set per-request so the semantics don't work anymore. So, rename to 'nextExpiringNode' and 'lastExpiringNode'. Also rename the node member elements "older" and "newer" to the more generic "previous" and "next". Change-Id: I582267d09c60c68396e4201e4a20185bbf0942e2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix documentation of QNetworkAccessBackendMårten Nordheim2021-09-011-0/+111
| | | | | | | | | | | | | | | | | | | The classes themselves were not documented, so...: Add some documentation for QNetworkAccessBackendFactory. Add some overall class docs for QNetworkAccessBackend. The class docs were marked \internal (because they mostly are). I don't think we yet have a defined way to handle semi-private APIs but having them be marked \internal and leaving the documentation in source seems fine (and was what someone suggested a while back). Add documentation for pure virtual functions which were overlooked. Pick-to: 6.2 Fixes: QTBUG-88774 Change-Id: Id7fe18ec92372abb96540cd29543608f87ec862e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessCache: Another fix to the linked list insertionMårten Nordheim2021-08-311-0/+2
| | | | | | | | | When inserting between two nodes the "previous" node's "newer" was forgotten and not updated. So every node's "newer" would point to the "newest" node. Change-Id: I5b0df8812be5f7f62b3ae363e4c78f582e0e5c43 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessCache: Remove unused codeMårten Nordheim2021-08-272-42/+0
| | | | | | | | The function was never called. As a consequence receiverQueue was only ever read and never written. Change-Id: I30905446452d9f263124d3af08c42e2e1b0cafbe Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkCookie: Clean upMårten Nordheim2021-08-271-8/+8
| | | | | | | | | | | | | Rewrite the regex to not capture the things we ignore anyway. Use capturedView to avoid allocating a string just to turn it into an int. Fix a (usually) ifdef-ed out piece of code that was still calling a QRegExp function. Make the QRegularExpression static const to save it from having to recompile every time. Change-Id: I2f4841a2bc35df4e6cea44aec72432410583f770 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkCookie: Fix use-after-freeMårten Nordheim2021-08-261-3/+4
| | | | | | | | | | | | The code was previously calling indexOf() on a temporary, which QRegularExpression would create backing storage for. After 11d1dcc6e263c5059f34b44d531c9ccdf7c0b1d6 the internals were made to use the QStringView path, which inadvertently meant that there was no storage for the temporary string anymore. So we need to keep it alive ourselves. Change-Id: I542da7010934594eba3b93261322963866ed9297 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* wasm: don’t dereference null reply pointerMorten Johan Sørvig2021-08-261-40/+33
| | | | | | | | | | | | | | | | | | | Move all access to the reply inside the nullptr check, while making sure to still call emscripten_fetch_close() unconditionally where needed. Make all four Emscripten callback handlers have a similar structure where we check if the reply is not null and not in the Aborted state. (This removes one emscripten_fetch_t nullptr check in stateChage(), if it is really the case that Emscripten calls us with a null emscripten_fetch_t then we should add it back.) Pick-to: 5.15 6.1 6.2 Change-Id: Iadcbe6338c338cfeb8967490e0951d8b3e1ec5b3 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* NetworkAccessBackend: Remove the backend part of the nameMårten Nordheim2021-08-261-1/+1
| | | | | | | | | | | | | | For consistency with naming of other plugins. Slight compatibility break, but this is semi-private API. [ChangeLog][Network][QNetworkAccessBackend] The NetworkAccessBackend plugin-type is renamed to NetworkAccess, if you have a plugin marked NetworkAccessBackend you need to change it to NetworkAccess. Pick-to: 6.2 Change-Id: Ib5ea02f542254b0f5b8c425c89ee00075a58c956 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessManager: move #ifery out of if-conditionMårten Nordheim2021-08-261-4/+8
| | | | | | | for legibility Change-Id: Id5bc2471e79bb8560cec46068cc72573f6adec34 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkAccessBackend: emit readyRead less oftenMårten Nordheim2021-08-261-1/+4
| | | | | | | | | Once per iteration of the loop wouldn't theoretically be so bad if there was no overhead to emitting signals or reading from buffers. Change-Id: I0e424264fcc95eb2e2e5f8f908cf9ae3a7cc4b7e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix inserting node entry in QNetworkAccessCache::linkEntryJonas Kvinge2021-08-241-0/+1
| | | | | | | | | | When the new entry has the same, or older timestamp than the newest, it's linked behind the newest entry, but "newest" for the new node currently isn't assigned to the newer entry. Fixes: QTBUG-95950 Change-Id: I7ef5f1ce5a9479ce47839c8f1a6011124d3f43de Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* wasm: fix unused variable warning/errorMorten Johan Sørvig2021-08-191-1/+1
| | | | | Change-Id: If6dabc94f6d64695a0b28e73061274f8ea1c4ed6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QDecompressHelper: Skip double-decompression if download is smallMårten Nordheim2021-08-042-18/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QDirIterator: add nextFileInfo()Marc Mutz2021-07-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Before this change, next() was the only way to advance the iterator, whether the caller was ultimately interested in just the filePath() (good) or not (bad luck, had to call .fileInfo()). Add a new function, nextFileInfo(), with returns fileInfo() instead. Incidentally, the returned object has already been constructed as part of advance()ing the iterator, so the new function is faster than next() even if the result is ignored, because we're not calculating a QString result the caller may not be interested in. Use the new function around the code. Fix a couple of cases of next(); fileInfo().filePath() (just use next()'s return value) as a drive-by. [ChangeLog][QtCore][QDirIterator] Added nextFileInfo(), which is like next(), but returns fileInfo() instead of filePath(). Change-Id: I601220575961169b44139fc55b9eae6c3197afb4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNetworkReply: hold QAtomicInt in shared_ptr, not QSharedPointerMarc Mutz2021-07-285-11/+11
| | | | | | | | | | | | Ditto QNetworkAccessAuthenticationManager. QSharedPointer performs twice as many atomic operations per pointer copy as std::shared_ptr, and this is private API, we're not bound by BC constraints, so we can port to the more efficient version. Change-Id: I59dc09ff4eb3b4acf5d7a68695752a9a7110d8d3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNAM: Allow to configure when connections to a host are torn downMarkus Goetz2021-07-277-14/+62
| | | | | | | | | | | | This introduces a new attribute that allows behavior to keep the TCP connection(s) to a HTTP1/HTTP2 host longer or shorter than the default of 120 seconds. Note that the server might still close the connection earlier. Fixes: QTBUG-20726 Fixes: QTBUG-91440 Change-Id: I7da64230a78c642c12c0ddbe6b678cf17c3aafde Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNetworkReply: Add two new signalsMarkus Goetz2021-07-2011-0/+54
| | | | | | | | | | | These signals allow monitoring where in the HTTP1/HTTP2 flow a request is currently in. Fixes: QTBUG-71698 Fixes: QTBUG-18766 Change-Id: Icc2fe435afc9f680fa7a76c32731e25fcdfeb4b4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNetworkDiskCache: Fix tracking of size during storeItem()Mårten Nordheim2021-07-201-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* H2: emit encrypted for at least the first reply, similar to H1Timur Pocheptsov2021-07-201-0/+4
| | | | | | | Pick-to: 6.2 6.1 5.15 Fixes: QTBUG-95277 Change-Id: I1fe01503376c0d6278e366d7bd31b412b7cc3a69 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Hold QSslContext in shared_ptrMarc Mutz2021-07-182-5/+5
| | | | | | | | | | | ... instead of QSharedPointer. QSharedPointer performs twice as many atomic operations per pointer copy as std::shared_ptr, and this is private API, we're not bound by BC constraints, so we can port to the more efficient version. Change-Id: I2e2a02493565a7ca51c86ec0ed66b6ce7c763e41 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* SSL: port QSharedPointer<QSslContext> uses to std-compatible API subsetMarc Mutz2021-07-161-6/+5
| | | | | | | | | | | In preparation of porting to shared_ptr. Add a few strategic moves and remove a rather pointless comment stating the obvious. Change-Id: Ie1c0f3431af79bdb204e00d99323bf9f2d100d0d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Export QHttpNetworkReply private to permit it to be used by websocketsØystein Heskestad2021-07-161-2/+2
| | | | | | | Task-number: QTBUG-80700 Change-Id: Ifec9c89a2cde5cae1ab98d95b43de21e5b4531fd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Hold QRingBuffer and QNonContiguousByteDevice in shared_ptrMarc Mutz2021-07-147-17/+23
| | | | | | | | | | | | ... instead of QSharedPointer. QSharedPointer performs twice as many atomic operations per pointer copy as std::shared_ptr, and this is private API, we're not bound by BC constraints, so we can port to the more efficient version. Change-Id: I9572a8321aae381e5dbe4a51119f2c9494a8fbc7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNetworkRequest: Fix decompression safety-check threshold docsMårten Nordheim2021-07-131-2/+2
| | | | | | | | | | The \sa was neglected Amends d33040548ff727a040ea66174cbd838e883fed56 Pick-to: 6.2 Change-Id: Ib298ac3390819f9ea4092a1f2bf470ea82c9e4fe Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Use QCryptographicHash::hash() more widelyMarc Mutz2021-07-071-3/+2
| | | | | | | | | | ... instead of the "usual" rule of three: ctor, addData(), result(). Not only does it generate less code in the caller, it's now also faster. Change-Id: I67c7eeb01f527b90e80a08f60c1c7f2ec1e49dd4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QNetworkRequest: Rename (set)minimumArchiveBombSizeMårten Nordheim2021-07-025-17/+18
| | | | | | | | | 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>
* H2 - make integer conversion explicit (signed->unsigned)Timur Pocheptsov2021-06-151-2/+2
| | | | | | | Pick-to: 6.2 Pick-to: 6.1 Change-Id: I47a3f8f7c39d4179a9a108e81a9c7f409acbc315 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* H2: remove a rather useless limit on the number of streamsTimur Pocheptsov2021-06-142-10/+3
| | | | | | | | | | | | | | | | | | SETTINGS for max concurrect number of streams is 'one direction' - this is how our peer conveys the possible number of streams _we_ can open, not _them_. If they choose to have it unlimited - let it be so. It's possible to send 0 as maximum number, also, it's possible to reduce the maximum compared to initial at some point - then I have to avoid integer overflows. Pick-to: 6.2 Pick-to: 6.1 Pick-to: 5.15 Fixes: QTBUG-94470 Change-Id: Ia02247acbaedd70998a4cab02082ba10f45cf78c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkReply: Decompress when readingMårten Nordheim2021-06-1211-122/+155
| | | | | | | | | | | Rather than when the data is received. Source compatibility is achieved through double-decompressing the data. This lets us know how many bytes are available just as before but without having the uncompressed data left in memory. Fixes: QTBUG-83269 Change-Id: I352bd09581614c582e4628243e2a0e895ba4946b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* wasm: fix network crash on abortLorn Potter2021-06-052-46/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also work around emscripten bug #8238 emcripten_fetch_close() does not abort the network request, but instead just free’s the emscripten_fetch_t object. onsuccess or onerror will still be called, but now with a stale pointer to the deleted emscripten_fetch_t object. See https://github.com/emscripten-core/emscripten/issues/8234 Work around this by setting the userData to null when we want to abort or are done with the request. The onerror and onsuccess callbacks can then check this field (on the the still valid emscripten_fetch_t), and bail out on the (from the Qt side) aborted request. Call emcripten_fetch_close() from on error and onsuccess; this should be the point when the emscripten request is done, and there will be no more callbacks. Pick-to: 5.15 Fixes: QTBUG-87813 Change-Id: Ie9b8a29037eb150c23741683588b0f0bfd5d8c63 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QNetworkRequest: Add API to set a minimum archive bomb sizeMårten Nordheim2021-05-319-39/+77
| | | | | | Fixes: QTBUG-91870 Change-Id: Ia23e8b8bcfdf65a91fe57e739242a355c681c9e6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-05-261-2/+2
| | | | | | Task-number: QTBUG-93990 Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add #include <mutex>Kimmo Ollila2021-05-251-0/+2
| | | | | | | | | Needed for having std::unique_lock Pick-to: 6.1 Change-Id: I3665e9e2afab0d9230778b8b36f2b7f0c8f44a2a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHttpNetworkConnectionPrivate::createAuthorization: refactorMårten Nordheim2021-05-201-7/+7
| | | | | | | | | Grab a reference to the channel instead of indexing into the array repeatedly. Change-Id: I114d571fcfcfd3a751346b513cec728dc2fcda0a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QHttpNetworkConnectionChannel: remove *authMethodMårten Nordheim2021-05-205-64/+31
| | | | | | | | | | | | | | | We store the authenticator right alongside it, which knows the method. The biggest change from this is changing a, self-proclaimed, duplicate method from QHttpNetworkReply. Finding the method name ahead-of-time is not actually needed, all we need to know is that a supported authentication method is requested. Also moved that specific functionality to a more logical location: QAuthenticatorPrivate. Change-Id: I11627803ccb42b8ec33a28ef1d1e00bf60dc6da9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Prefer previously used channels in QHttpNetworkConnectionLars Schmertmann2021-05-111-19/+38
| | | | | | | | | | | | | | | | | | When IPv4 and IPv6 are supported by a server, QHttpNetworkConnection will start up two connections and pick the network layer of the one that finish first. In this case the channel with index 1 is used for IPv6. When IPv6 wins, there is no channel at index 0. This situation needs to be respected and we should try to use existing channels first when there is a next request. This is especially important when TLS session resumption is used. Creating a new channel will cause to lose the ephemeralServerKey used in the first connection. Fixes: QTBUG-93295 Pick-to: 5.15 6.1 Change-Id: Ic9dc6a24ef793a29c2652ad37bc11120e2e6ceef Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix “unused variable” warningMorten Sørvig2021-04-301-0/+1
| | | | | Change-Id: I6755cb05064c87d9b619bc4ff06e70740d94ccb3 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* HTTP: Don't call allDone twiceMårten Nordheim2021-04-291-0/+2
| | | | | | Change-Id: Ia3fb2e2c185f4e61234ce237416028b0c45357f8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* HTTP/2 authentication requiredMårten Nordheim2021-04-295-29/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | With Qt 6 we made HTTP/2 default, which exposed missing handling of 401 Unauthorized (and 407 Proxy Authentication Required). In HTTP/1.* we would handle this after the response had finished, while handling the status code. For h2 this path isn't used since it is heavily reliant on the structure we have for HTTP/1.* (one request per channel). So we must handle the status code and header directly. Having that part fixed exposed another issue - when resetting/rewinding uploaded data we were not resetting the 'totallyUploadedData' counter in the reply (this, in turn, exposed another small issue). Because of that we did not actually send any data on the retry, only sending the content-length followed by no data. Finally, the small issue mentioned in the previous paragraph was how we check if we have uploaded all our data. It was only checking if the byte-device was atEnd(), which it was. But only because it had not yet prepared any data for us. Fixes: QTBUG-91284 Pick-to: 6.1 6.0 5.15 Change-Id: I798d105b02688b18a02897cc476f19f57a47f98f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkDiskCache: Switch to unique_ptr in most casesMårten Nordheim2021-04-161-4/+6
| | | | | | | | | Because take() is deprecated, and these pointers are meant to leave the scope in some branches. Pick-to: 6.1 Change-Id: I5432d91a28f4c5c8c17fadf7ce3bcd41716e216a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkDiskCache: Drop the file mmap-ingMårten Nordheim2021-04-161-12/+1
| | | | | | | | | | | | | | Presumably the code at some point would do a QByteArray::fromRawData-style thing. But now it doesn't do that so the current code was a bit strange. It would map the content of the file to memory only to then copy the content into a QByteArray. Then it reparents the file to the QBuffer, keeping it alive even if its not needed. Fixes: QTBUG-92838 Pick-to: 6.1 6.0 5.15 Change-Id: I88f8cd1b64e0fd13d08b5cc4df44661e216da340 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkCookie: Rename sameSite to sameSitePolicyMårten Nordheim2021-04-142-8/+8
| | | | | | | | | As suggested in the API review. Amends 37bd7b5733c7f1a4eb6ac5458fdc46f94a91194a Pick-to: 6.1 6.1.0 Change-Id: Ic3e8567f349568dc3b4dbf79be27c304b39480cf Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>