From 893e22691de2c2b4cc2f8a4fb3077f4ee974eb9c Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 10 Feb 2016 15:38:21 +0100 Subject: [PATCH] ConnectionValidator: Make sure we intercept propfind error 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 | 2 +- src/libsync/networkjobs.cpp | 2 +- src/libsync/networkjobs.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libsync/connectionvalidator.cpp b/src/libsync/connectionvalidator.cpp index ca4e79705a..b57b4cf200 100644 --- a/src/libsync/connectionvalidator.cpp +++ b/src/libsync/connectionvalidator.cpp @@ -173,7 +173,7 @@ void ConnectionValidator::checkAuthentication() job->setTimeout(timeoutToUseMsec); job->setProperties(QList() << "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(); } diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp index 5a51a4e449..c4c3c3510b 100644 --- a/src/libsync/networkjobs.cpp +++ b/src/libsync/networkjobs.cpp @@ -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; } diff --git a/src/libsync/networkjobs.h b/src/libsync/networkjobs.h index 62048d80a6..c2cc978c4d 100644 --- a/src/libsync/networkjobs.h +++ b/src/libsync/networkjobs.h @@ -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;