Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-73346

WASM: QNetworkReply, after calling abort QNetworkReply->error() is not OperationCanceledError

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.12.1
    • Fix Version/s: 5.14.0 Alpha
    • Component/s: Network
    • Labels:
      None
    • Environment:
       Fedora 28 / Firefox 63.0.3
      emsdk-1.38.21-64bit
    • Platform/s:
      WebAssembly
    • Commits:
      a9cd8ce2961190e51c59cdd34c26c5b6f4c70aa1

      Description

      I applied the fix from https://bugreports.qt.io/browse/QTBUG-72516 to my Qt 5.12.0 source manually(Without it finished is not emitted).

      The attached example makes an http request to "http://urlecho.appspot.com:81/echo" on clicking "Go" with a 3 seconds timeout that calls abort.
      Since the request can not work for port 81 the timeout should always trigger.
      The signal finished is emitted but QNetworkReply::error() does not return the expected OperationCanceledError.
       

      In the following image you can see what happens in the attached example on Linux:

      And Webassembly:

       

      I fixed it for myself like this:

      // qtbase/src/network/access/qnetworkreplywasmimpl.cpp
      void QNetworkReplyWasmImpl::abort()
      {
      	Q_D(const QNetworkReplyWasmImpl);
      	d->doAbort();	
      	setError( QNetworkReply::OperationCanceledError, "Operation canceled" ); // Fixed it for me
          close();
      }
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            lpotter Lorn Potter
            Reporter:
            Marscho Marscho
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes