[Pkg-owncloud-commits] [owncloud-client] 85/103: Add a compile option to not blacklist error code 5xx

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Apr 30 18:09:02 UTC 2014


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 f159b028b486b96f2d1a33258848ef2dc97e9790
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Tue Apr 29 11:39:46 2014 +0200

    Add a compile option to not blacklist error code 5xx
---
 CMakeLists.txt                    | 8 ++++++++
 src/mirall/owncloudpropagator.cpp | 5 +++++
 2 files changed, 13 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e8705f8..cfe1b99 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,6 +85,14 @@ endif()
 # this option creates only libocsync and libowncloudsync
 option(BUILD_LIBRARIES_ONLY "BUILD_LIBRARIES_ONLY" OFF)
 
+# When this option is enabled, 5xx errors are not added to the clacklist
+# Normaly you don't want to enable this option because if a particular file
+# trigger a bug on the server, you want the file to be blacklisted.
+option(OWNCLOUD_5XX_NO_BLACKLIST "OWNCLOUD_5XX_NO_BLACKLIST" OFF)
+if(OWNCLOUD_5XX_NO_BLACKLIST)
+    add_definitions(-DOWNCLOUD_5XX_NO_BLACKLIST=1)
+endif()
+
 #### find libs
 #find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtTest QtWebkit REQUIRED )
 #if( UNIX AND NOT APPLE ) # Fdo notifications
diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp
index 86df5c4..66c6884 100644
--- a/src/mirall/owncloudpropagator.cpp
+++ b/src/mirall/owncloudpropagator.cpp
@@ -45,6 +45,11 @@ void PropagateItemJob::done(SyncFileItem::Status status, const QString &errorStr
     if( _item._httpErrorCode == 403 ||_item._httpErrorCode == 413 || _item._httpErrorCode == 415 ) {
         qDebug() << "Fatal Error condition" << _item._httpErrorCode << ", forbid retry!";
         retries = -1;
+#ifdef OWNCLOUD_5XX_NO_BLACKLIST
+    } else if (_item._httpErrorCode / 100 == 5) {
+        // In this configuration, never blacklist error 5xx
+        qDebug() << "Do not blacklist error " << _item._httpErrorCode;
+#endif
     } else {
         static QAtomicInt defaultRetriesCount(qgetenv("OWNCLOUD_BLACKLIST_COUNT").toInt());
         if (defaultRetriesCount.fetchAndAddAcquire(0) <= 0) {

-- 
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