From: Olivier Goffart Date: Wed, 10 Feb 2016 14:38:21 +0000 (+0100) Subject: ConnectionValidator: Make sure we intercept propfind error X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~1254^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=893e22691de2c2b4cc2f8a4fb3077f4ee974eb9c;p=nextcloud-desktop.git 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 --- diff --git a/src/libsync/connectionvalidator.cpp b/src/libsync/connectionvalidator.cpp index ca4e79705..b57b4cf20 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 5a51a4e44..c4c3c3510 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 62048d80a..c2cc978c4 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;