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

QNetworkAccessManager doens't emit finished() signal on 2nd attempt

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 4.5.3
    • Network
    • None

    Description

      If QNetworkAccessManager succeed doing a request, the next one that fails don't fire the finished() signal.

      Here is some test code:

      void foo::finished(QNetworkReply* r)
      {
      printf("finished %s %d\n", qPrintable(r->url().toString()), r->error());
      r->manager()->get(QNetworkRequest(QUrl("http://google.com")));
      r->deleteLater();
      }

      foo::foo(QObject* parent) : QObject(parent)
      {
      QNetworkAccessManager* m = new QNetworkAccessManager(this);
      connect(m, SIGNAL(finished(QNetworkReply*)), this, SLOT(finished(QNetworkReply*)));
      m->get(QNetworkRequest(QUrl("http://google.com")));
      }

      Run this, and after it starts reporting success unplug the network.

      Attachments

        Issue Links

          Activity

            People

              stormols Marius Storm-Olsen
              philippe.vaucher Philippe Vaucher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: