diff --git a/src/libsync/owncloudpropagator_p.h b/src/libsync/owncloudpropagator_p.h index c3c68aa7126..293038a2bb9 100644 --- a/src/libsync/owncloudpropagator_p.h +++ b/src/libsync/owncloudpropagator_p.h @@ -49,7 +49,9 @@ inline QByteArray getEtagFromReply(QNetworkReply *reply) /** * Fiven an error from the network, map to a SyncFileItem::Status error */ -inline SyncFileItem::Status classifyError(QNetworkReply::NetworkError nerror, int httpCode) { +inline SyncFileItem::Status classifyError(QNetworkReply::NetworkError nerror, + int httpCode, + bool* anotherSyncNeeded = NULL) { Q_ASSERT (nerror != QNetworkReply::NoError); // we should only be called when there is an error if (nerror > QNetworkReply::NoError && nerror <= QNetworkReply::UnknownProxyError) { @@ -72,6 +74,7 @@ inline SyncFileItem::Status classifyError(QNetworkReply::NetworkError nerror, in if (httpCode == 423) { // "Locked" // Should be temporary. + if (anotherSyncNeeded) { *anotherSyncNeeded = true; } return SyncFileItem::SoftError; } diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index 2730ebf5975..1dd6e290150 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -481,7 +481,8 @@ void PropagateDownloadFileQNAM::slotGetFinished() SyncFileItem::Status status = job->errorStatus(); if (status == SyncFileItem::NoStatus) { - status = classifyError(err, _item->_httpErrorCode); + status = classifyError(err, _item->_httpErrorCode, + &_propagator->_anotherSyncNeeded); } done(status, job->errorString()); diff --git a/src/libsync/propagateremotedelete.cpp b/src/libsync/propagateremotedelete.cpp index 5f7fc897ffb..645370681bf 100644 --- a/src/libsync/propagateremotedelete.cpp +++ b/src/libsync/propagateremotedelete.cpp @@ -95,7 +95,8 @@ void PropagateRemoteDelete::slotDeleteJobFinished() return; } - SyncFileItem::Status status = classifyError(err, _item->_httpErrorCode); + SyncFileItem::Status status = classifyError(err, _item->_httpErrorCode, + &_propagator->_anotherSyncNeeded); done(status, _job->errorString()); return; } diff --git a/src/libsync/propagateremotemkdir.cpp b/src/libsync/propagateremotemkdir.cpp index 6d97ec1e308..019a2b19c90 100644 --- a/src/libsync/propagateremotemkdir.cpp +++ b/src/libsync/propagateremotemkdir.cpp @@ -57,7 +57,8 @@ void PropagateRemoteMkdir::slotMkcolJobFinished() if (_item->_httpErrorCode == 405) { // This happens when the directory already exist. Nothing to do. } else if (err != QNetworkReply::NoError) { - SyncFileItem::Status status = classifyError(err, _item->_httpErrorCode); + SyncFileItem::Status status = classifyError(err, _item->_httpErrorCode, + &_propagator->_anotherSyncNeeded); auto errorString = _job->reply()->errorString(); if (_job->reply()->hasRawHeader("OC-ErrorString")) { errorString = _job->reply()->rawHeader("OC-ErrorString"); diff --git a/src/libsync/propagateremotemove.cpp b/src/libsync/propagateremotemove.cpp index 8b9af4eb12a..8df44a73eaa 100644 --- a/src/libsync/propagateremotemove.cpp +++ b/src/libsync/propagateremotemove.cpp @@ -128,7 +128,8 @@ void PropagateRemoteMove::slotMoveJobFinished() return; } - SyncFileItem::Status status = classifyError(err, _item->_httpErrorCode); + SyncFileItem::Status status = classifyError(err, _item->_httpErrorCode, + &_propagator->_anotherSyncNeeded); done(status, _job->errorString()); return; } diff --git a/src/libsync/propagateupload.cpp b/src/libsync/propagateupload.cpp index 0ef14c0234e..e90fee64dca 100644 --- a/src/libsync/propagateupload.cpp +++ b/src/libsync/propagateupload.cpp @@ -582,7 +582,9 @@ void PropagateUploadFileQNAM::slotPutFinished() _propagator->_anotherSyncNeeded = true; } - abortWithError(classifyError(err, _item->_httpErrorCode), errorString); + SyncFileItem::Status status = classifyError(err, _item->_httpErrorCode, + &_propagator->_anotherSyncNeeded); + abortWithError(status, errorString); return; }