From a810d69daa1174d13ab7594f9d6989a9596d2efe Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 20 Sep 2016 11:55:43 +0200 Subject: [PATCH] ConnectionValidator: properly handle error in status.php (#5188) We wwer enot connecting to the right signal from the check server job, and therefore we were not catching the condition in which the json was invalid. We would then never terminate the ConnectionValidator job. Note that instanceNotFound is also emited if there is a network error. The log looked like this: 10:25:51.247 OCC::CheckServerJob::finished: status.php from server is not valid JSON! 10:25:51.248 OCC::CheckServerJob::finished: status.php returns: QMap() QNetworkReply::NetworkError(NoError) Reply: QNetworkReplyHttpImpl(0x2b6a790) 10:25:51.248 OCC::CheckServerJob::finished: No proper answer on QUrl("http://localhost/~owncloud/status.php") 10:26:23.235 OCC::AccountState::checkConnectivity: ConnectionValidator already running, ignoring "owncloud@localhost" 10:26:55.235 OCC::AccountState::checkConnectivity: ConnectionValidator already running, ignoring "owncloud@localhost" [...] (cherry picked from commit ff701bd473242b417e8ef9b987d4593e1495020c) --- src/libsync/connectionvalidator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsync/connectionvalidator.cpp b/src/libsync/connectionvalidator.cpp index 2a955a5214..a1eead282d 100644 --- a/src/libsync/connectionvalidator.cpp +++ b/src/libsync/connectionvalidator.cpp @@ -106,7 +106,7 @@ void ConnectionValidator::slotCheckServerAndAuth() checkJob->setTimeout(timeoutToUseMsec); checkJob->setIgnoreCredentialFailure(true); connect(checkJob, SIGNAL(instanceFound(QUrl,QVariantMap)), SLOT(slotStatusFound(QUrl,QVariantMap))); - connect(checkJob, SIGNAL(networkError(QNetworkReply*)), SLOT(slotNoStatusFound(QNetworkReply*))); + connect(checkJob, SIGNAL(instanceNotFound(QNetworkReply*)), SLOT(slotNoStatusFound(QNetworkReply*))); connect(checkJob, SIGNAL(timeout(QUrl)), SLOT(slotJobTimeout(QUrl))); checkJob->start(); }