[Pkg-owncloud-commits] [owncloud-client] 15/69: discovery: handle 503 reply code from server for directories

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Nov 7 19:41:06 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 0692fea9d8304d1c54c2f35bda2133276d38b866
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Mon Oct 27 19:21:12 2014 +0100

    discovery: handle 503 reply code from server for directories
    
    503 for directories means that the dir is a mounted directory from an
    external mount which currently is not available. The directory is
    ignored and not traversed into during discovery phase.
---
 csync/src/csync_update.c  | 11 +++++++++++
 src/mirall/syncengine.cpp |  8 ++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/csync/src/csync_update.c b/csync/src/csync_update.c
index d5d1fc0..8063557 100644
--- a/csync/src/csync_update.c
+++ b/csync/src/csync_update.c
@@ -581,6 +581,17 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
           if (asp < 0) {
               CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "asprintf failed!");
           }
+      } else if(errno == ERRNO_SERVICE_UNAVAILABLE) {
+          CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Service was not available!");
+          if (ctx->current_fs) {
+              ctx->current_fs->instruction = CSYNC_INSTRUCTION_IGNORE;
+              ctx->current_fs->error_status = CSYNC_STATUS_SERVICE_UNAVAILABLE;
+              /* If a directory has ignored files, put the flag on the parent directory as well */
+              if( previous_fs ) {
+                  previous_fs->has_ignored_files = true;
+              }
+              goto done;
+          }
       } else {
           CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "opendir failed for %s - errno %d", uri, errno);
       }
diff --git a/src/mirall/syncengine.cpp b/src/mirall/syncengine.cpp
index db632d2..e93e6eb 100644
--- a/src/mirall/syncengine.cpp
+++ b/src/mirall/syncengine.cpp
@@ -179,7 +179,9 @@ QString SyncEngine::csyncErrorToString(CSYNC_STATUS err)
     case CSYNC_STATUS_ABORTED:
         errStr = tr("Aborted by the user");
         break;
-
+    case CSYNC_STATUS_SERVICE_UNAVAILABLE:
+	errStr = tr("The mounted directory is temporary not available on the server");
+	break;
     default:
         errStr = tr("An internal error number %1 happened.").arg( (int) err );
     }
@@ -370,7 +372,9 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
     case CYSNC_STATUS_FILE_LOCKED_OR_OPEN:
         item._errorString = QLatin1String("File locked"); // don't translate, internal use!
         break;
-
+    case CSYNC_STATUS_SERVICE_UNAVAILABLE:
+        item._errorString = QLatin1String("Directory temporarily not available on server.");
+        break;
     default:
         Q_ASSERT("Non handled error-status");
         /* No error string */

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