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

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

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes