qt6-bb10/src/network
Lorn Potter 75b0e8d599 wasm: fix network crash on abort
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>
2021-06-05 07:08:21 +10:00
..
access wasm: fix network crash on abort 2021-06-05 07:08:21 +10:00
android/jar Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
doc Fix changes' doc 2021-05-04 22:11:24 +02:00
kernel QNetworkInformation: Behind captive portal 2021-05-31 17:25:22 +02:00
socket Consolidate debug string generation 2021-05-31 21:50:07 +03:00
ssl QSsl::ImplementedClass - add DtlsCookie 2021-05-27 06:41:16 +02:00
.prev_configure.cmake CMake: Regenerate configure.cmake files 2021-04-27 21:33:48 +02:00
CMakeLists.txt Move plugin code from QtNetwork to qtbase/plugins 2021-04-22 22:51:54 +02:00
configure.cmake Move plugin code from QtNetwork to qtbase/plugins 2021-04-22 22:51:54 +02:00
configure.json CMake: Regenerate configure.cmake files 2021-04-27 21:33:48 +02:00
qt_cmdline.cmake CMake: Re-implement configure/qmake's command line handling in CMake 2020-08-17 08:08:20 +02:00