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

QNetworkAccessManager stalled FTP requests after abort

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.6.2, 5.8.0
    • Network, Network: FTP
    • None
    • OSX 10.11.6
    • 4a6cb89f2944b5d8ee3e50fd3a2085eba9189680

    Description

      Aborting a FTP QNetworkReply (QNetworkReply::abort) once makes the QNetworkAccessManager unable to complete any subsequent FTP requests to the same host. Presumably this is related to FTP connection cache, and FTP abort (i.e. the FTP connection remains in the cache but is possibly unusable).

      An example test project is attached with the main.cpp repeated here:

      #include <cassert>
      #include <QCoreApplication>
      #include <QUrl>
      #include <QNetworkAccessManager>
      #include <QNetworkReply>
      #include <QNetworkRequest>
      #include <QSignalSpy>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
          QNetworkAccessManager nam;
          QUrl url("ftp://mirror.netcologne.de/qtproject/archive/qt/5.7/5.7.1/md5sums.txt");
          QNetworkReply *reply = nam.get(QNetworkRequest(url));
          QSignalSpy spy(reply, SIGNAL(downloadProgress(qint64, qint64)));
      
          assert(spy.wait(5000));  // suceeds
      
          reply->abort();
          reply->deleteLater();
      
          reply = nam.get(QNetworkRequest(url)); // try again to the same host after abort.
          QSignalSpy spy_1(reply, SIGNAL(downloadProgress(qint64, qint64)));
      
          assert(spy_1.wait(5000));  // fails, any request to the same host stalls forever
      
          return 0;
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              tpochep Timur Pocheptsov
              aleserjavec Ales Erjavec
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes