[Pkg-owncloud-commits] [owncloud-client] 06/159: Remote delete: Consider 404 a success. #2919
Sandro Knauß
hefee-guest at moszumanska.debian.org
Fri May 1 13:05:15 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 89f831e7d4fa6f27c48d34fba54583d3edb7f50d
Author: Christian Kamm <kamm at incasoftware.de>
Date: Fri Mar 13 10:55:53 2015 +0100
Remote delete: Consider 404 a success. #2919
---
src/libsync/propagateremotedelete.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/libsync/propagateremotedelete.cpp b/src/libsync/propagateremotedelete.cpp
index 8cbcf72..15f1c88 100644
--- a/src/libsync/propagateremotedelete.cpp
+++ b/src/libsync/propagateremotedelete.cpp
@@ -85,9 +85,10 @@ void PropagateRemoteDelete::slotDeleteJobFinished()
<< (_job->reply()->error() == QNetworkReply::NoError ? QLatin1String("") : _job->reply()->errorString());
QNetworkReply::NetworkError err = _job->reply()->error();
- _item._httpErrorCode = _job->reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+ const int httpStatus = _job->reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+ _item._httpErrorCode = httpStatus;
- if (err != QNetworkReply::NoError) {
+ if (err != QNetworkReply::NoError && err != QNetworkReply::ContentNotFoundError) {
if( checkForProblemsWithShared(_item._httpErrorCode,
tr("The file has been removed from a read only share. It was restored.")) ) {
@@ -102,7 +103,11 @@ void PropagateRemoteDelete::slotDeleteJobFinished()
_item._requestDuration = _job->duration();
_item._responseTimeStamp = _job->responseTimestamp();
- if (_item._httpErrorCode != 204 ) {
+ // A 404 reply is also considered a success here: We want to make sure
+ // a file is gone from the server. It not being there in the first place
+ // is ok. This will happen for files that are in the DB but not on
+ // the server or the local file system.
+ if (httpStatus != 204 && httpStatus != 404) {
// Normaly we expect "204 No Content"
// If it is not the case, it might be because of a proxy or gateway intercepting the request, so we must
// throw an error.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list