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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 4.5.3
    • Fix Version/s: None
    • Component/s: Network
    • Labels:
      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

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

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes