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

Do not use direct starting of HTTP request if in a slot that was triggered by same QNAM

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • None
    • Network
    • None

      (talk to Markus about this)

      We seem to have this code already:

      void QHttpNetworkConnectionChannel::allDone()
      [...]
          bool emitFinished = reply->d_func()->shouldEmitSignals();
      [...]
          // queue the finished signal, this is required since we might send new requests from
          // slot connected to it. The socket will not fire readyRead signal, if we are already
          // in the slot connected to readyRead
          if (emitFinished)
              QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection);
      [...]
      

      which is bad worse for performance since it means that we will always go via the event loop when a HTTP request is finished.
      What we should do is emit finished() directly and while emitting set something like QNetworkAccessManagerPrivate.isEmitting=true.
      Then when a new get() is requested in the QNAM we would check the isEmitting first and will only go the "direct sending" way if it is false.

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

            Unassigned Unassigned
            mgoetz Markus Goetz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes