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

Last QNetworkReply::readyRead() is not always emitted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 6.4.0 RC1, 6.5.0 Beta1
    • 6.3.1, 6.4.0 Beta4
    • Network: HTTP
    • None
    • Ubuntu 22.04
    • Linux/X11
    • 5387b88aa9 (qt/qtbase/dev) 5387b88aa9 (qt/tqtc-qtbase/dev) 3a7646f02a (qt/qtbase/6.4.0) 98ef806830 (qt/qtbase/6.4) 766d71ef71 (qt/qtbase/6.3) 766d71ef71 (qt/tqtc-qtbase/6.3) 98ef806830 (qt/tqtc-qtbase/6.4) 3a7646f02a (qt/tqtc-qtbase/6.4.0)

    Description

      The HTTP example (https://doc.qt.io/qt-6/qtnetwork-http-example.html) does not work with Qt 6.

      The last readyRead() signal is not always emitted.
      That means that when finished() is emitted and httpFinished() is executed, there are still some data to be read inside the QNetworkReply.

      Adding some qDebug() in the example, I have "randomly" one of these 3 ouputs:

      void HttpWindow::httpReadyRead()
      Read 32768 bytes
      void HttpWindow::httpReadyRead()
      Read 43866 bytes
      void HttpWindow::httpFinished()
      no more data
      
      void HttpWindow::httpFinished()
      76634 bytes of data left
      
      void HttpWindow::httpReadyRead()
      Read 32768 bytes
      void HttpWindow::httpFinished()
      43866 bytes of data left
      

      With Qt 5.15 the last readyRead() seems always emitted:

      void HttpWindow::httpReadyRead()
      Read 10623 bytes
      void HttpWindow::httpReadyRead()
      Read 49241 bytes
      void HttpWindow::httpReadyRead()
      Read 11277 bytes
      void HttpWindow::httpReadyRead()
      Read 4222 bytes
      void HttpWindow::httpReadyRead()
      Read 1271 bytes
      void HttpWindow::httpFinished()
      no more data
      
      void HttpWindow::httpReadyRead()
      Read 76634 bytes
      void HttpWindow::httpFinished()
      no more data
      

      Attachments

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

        Activity

          People

            manordheim MÃ¥rten Nordheim
            bterrier Benjamin Terrier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes