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

QNetworkAccessFtpBackend::closeDownstreamChannel may call abort if close() is called on QNetworkReply

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.1, 5.0.0
    • 4.7.3
    • Network: FTP
    • None
    • Gentoo Linux, Qt 4.7.3
    • a28c433b290dae1b3509ddf1eee616ba91ce221b (5.0), 6c4c5709a3f6150c4e37f38c7e7fd980ab359a53 (4.8)

    Description

      If the application decides to cancel a download on a QNetworkReply object as created by a QNetworkAccessManager instance, the close() function seems to do the job for HTTP downloads. For FTP downloads, this does not work if the FTP server is very slow (i.e. not responding in reasonable time). Calling close() in such a situation may lead to that QNetworkAccessFtpBackend::closeDownstreamChannel is called which may abort the program without any notification.
      First, an abort() without any warning message is a bad thing (TM) as it makes it unnecesssarily hard to trace the origin of the crash. Not even a source code comment (in 4.7.3) does explain why abort is called.
      Second, IP networks are best-effort only, so anything can go wrong and no application should stop working just because network packets do not arrive in time.

      I have no ready-to-use minimum example code, but it should be reproducible by simply issuing a get(...) on a QNetworkAccessManager and on the resulting QNetworkReply object calling close() after a second or so.
      The FTP address where I observed this crash is ftp://ftp.cricyt.edu.ar/pub/dnv/informes/parciales/Informe%20029R.doc

      Attachments

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

        Activity

          People

            shkearns Shane Kearns
            thfischer T. Fischer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes