Details
Description
There are multiple problems with sending request and QNetworkReply on WebAssembly platform:
- The request can only be send from main thread. There was a fix which proxied request to main thread but it was reverted as it introduced another problems.
- Cancelling the request is done by setting m_fetch->userData to nullptr. This can be done better by calling emscripten_fetch_close().
- Request is not cancel when QNetworkReply is deleted. This can lead to use-after-free by emscripten fetch. Doublecheck the lifetimes of objects passed to emscripten_fetch().
Related: QTBUG-122893
Attachments
For Gerrit Dashboard: QTBUG-124111 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
553381,9 | wasm: Abort network request on destruction of QNetworkReply | dev | qt/qtbase | Status: MERGED | +2 | 0 |
553584,25 | wasm: Allow fetching from background thread | dev | qt/qtbase | Status: MERGED | +2 | 0 |
555389,2 | wasm: Abort network request on destruction of QNetworkReply | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |