summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkreplywasmimpl_p.h
Commit message (Collapse)AuthorAgeFilesLines
* wasm: Allow fetching from background threadPiotr Wierciński3 days1-1/+25
| | | | | | | | | | | | | | | | | Allow network request from background thread by proxing it to main thread if needed. Introduce "fetchHelper" which is stored on heap and owns "outgoingData" which must be valid during entire fetch operation. It is also used for synchronization between thread that has scheduled fetch operation and the one that is executing it. Enable the test that was skipped before fix. Fixes: QTBUG-124111 Change-Id: Ifafa4c40fa435122639fa861a61fbf96340a7747 Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* NetworkReply[wasm]: simplify some buffer passingMårten Nordheim2024-04-051-2/+2
| | | | | | | | | | | | It was always passing a QByteArray to a const char * argument, with the size along with it. That was immediately converted back to a QByteArray. Instead, just pass the byte array which anyway knows its size. Needed for a followup commit Change-Id: I821d419adcb600456826dde67fb92ecad11cb290 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* wasm: fix crash when network reply is closedLorn Potter2022-10-191-0/+1
| | | | | | | | | | We do not need to call QNetworkReply::close as that closes the QIODevice that we do not use (or have) Pick-to: 6.4 Fixes: QTBUG-77210 Change-Id: I812bc324f49ae28b8c622cfa89f9690e012bf216 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QNetworkReply: hold QAtomicInt in shared_ptr, not QSharedPointerMarc Mutz2021-07-281-2/+2
| | | | | | | | | | | | 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>
* Hold QRingBuffer and QNonContiguousByteDevice in shared_ptrMarc Mutz2021-07-141-1/+3
| | | | | | | | | | | | ... 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>
* wasm: fix network crash on abortLorn Potter2021-06-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* wasm: fix network status code propagationLorn Potter2020-09-251-0/+1
| | | | | | | | Fixes: QTBUG-86620 Pick-to: 5.15 Change-Id: I911636739dc57e47bc2a07a583f4e67fc08b1b19 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix network POST data corruptionLorn Potter2020-06-111-0/+1
| | | | | | | | | | Emscripten does not like when the post data gets deleted in the local scope. Fixes: QTBUG-84685 Pick-to: 5.15 Change-Id: I17f9d5cc3253c26b42253daa68e2fbaccc48eaf6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: set status codes from network operationLorn Potter2020-05-251-0/+2
| | | | | | | Pick-to: 5.15 Fixes: QTBUG-83991 Change-Id: Ie1e88189bee8b6a9dc6cb2a721777a5e1032307a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix heap crash when making multiple network callsLorn Potter2020-05-251-1/+1
| | | | | | | Pick-to: 5.15 Task-number: QTBUG-83991 Change-Id: I354934b53799f3eeb958395932bed18289b1e279 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: refactor network to use fetch APILorn Potter2020-03-261-4/+10
| | | | | | | | | | This has better support for threaded use, and gets rid of bind use. This requires emscripten 1.38.37 and above Task-number: QTBUG-76891 Change-Id: Ic30a6820c2ce945c314751c06cfc356914a71217 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: emit finished after QNetworkReply abortLorn Potter2018-12-181-0/+4
| | | | | | Change-Id: I23445f5e0c936b82aa5d65b261d456a563deab9a Fixes: QTBUG-72516 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: rewrite QNetworkReplyWasmImpl to remove EM_ASMLorn Potter2018-10-091-13/+3
| | | | | | | | | and fix handling of incoming binary data Change-Id: I31e97505ad4ff64cf8e380df5d0d6b70c3cd60b0 Reviewed-by: Ryan Chu <ryan.chu@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* WebAssembly for QtBaseMorten Johan Sørvig2018-08-301-0/+153
This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>