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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.14.0 Alpha
    • 5.12.1
    • Network
    • None
    •  Fedora 28 / Firefox 63.0.3
      emsdk-1.38.21-64bit
    • WebAssembly
    • 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

        For Gerrit Dashboard: QTBUG-73346
        # Subject Branch Project Status CR V

        Activity

          People

            lpotter Lorn Potter
            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