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

QNetworkReply::readData returns empty buffer, though readyRead is emitted and data is there

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 5.7, 5.8, 5.9, 5.10
    • Network, Network: FTP
    • None
    • Android 5.0

    Description

      I use QNetworkAccessManager on Android to download file via FTP protocol and when readyRead signal is emitted, QNetworkReply::readData() return empty byte array, and QNetworkReply::bytesAvailable() method returns 0 bytes. Though I know that data is there (via Wireshark) and readyRead() emitted many times.
      The same code on Ubuntu 16.04 works fine.

      I checked qnetworkreplyimpl.cpp code and saw that in QT 5.6, in readData() method bytes are copied to return buffer, while in 5.7 this code has been removed, and only special case "zero copy buffer" is handled in readData() method. I suspect that on Android this "zero copy buffer" case is not valid.

      I do not provide the sample code, as I believe, I spotted the exact place where the issue should be, and FTP GET is covered by QT tests.

       

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            rightaway717 Ivan Belyakov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes