ConnectionValidator: Make sure we intercept propfind error
authorOlivier Goffart <ogoffart@woboq.com>
Wed, 10 Feb 2016 14:38:21 +0000 (15:38 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Wed, 10 Feb 2016 14:38:21 +0000 (15:38 +0100)
If the PROPFIND return an invalid code (like 200) then we would
not recieve the error signal and we would never sync again.

Found while investigating https://github.com/owncloud/enterprise/issues/1068

src/libsync/connectionvalidator.cpp
src/libsync/networkjobs.cpp
src/libsync/networkjobs.h

index ca4e79705a042ad5422578da8dbd87211875b3d0..b57b4cf200ca339d15d8c0e8e2bf51c4c6835152 100644 (file)
@@ -173,7 +173,7 @@ void ConnectionValidator::checkAuthentication()
     job->setTimeout(timeoutToUseMsec);
     job->setProperties(QList<QByteArray>() << "getlastmodified");
     connect(job, SIGNAL(result(QVariantMap)), SLOT(slotAuthSuccess()));
-    connect(job, SIGNAL(networkError(QNetworkReply*)), SLOT(slotAuthFailed(QNetworkReply*)));
+    connect(job, SIGNAL(finishedWithError(QNetworkReply*)), SLOT(slotAuthFailed(QNetworkReply*)));
     job->start();
 }
 
index 5a51a4e4499355b10da14a17dc4ca63e482b8896..c4c3c3510bda283d82fe910e1b9b87e775bdbaed 100644 (file)
@@ -558,7 +558,7 @@ bool PropfindJob::finished()
     } else {
         qDebug() << "PROPFIND request *not* successful, http result code is" << http_result_code
                  << (http_result_code == 302 ? reply()->header(QNetworkRequest::LocationHeader).toString()  : QLatin1String(""));
-        emit finishedWithError();
+        emit finishedWithError(reply());
     }
     return true;
 }
index 62048d80a6ed7bb562710b0bd81e08bd85a76df7..c2cc978c4dc4c13897667dae80deef89609fa28c 100644 (file)
@@ -118,7 +118,7 @@ public:
 
 signals:
     void result(const QVariantMap &values);
-    void finishedWithError();
+    void finishedWithError(QNetworkReply *reply = 0);
 
 private slots:
     virtual bool finished() Q_DECL_OVERRIDE;