[Pkg-owncloud-commits] [owncloud-client] 59/115: Update phase progress: Check if callback is defined.

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Aug 29 22:04:01 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 ddbe181e483df77c9339b49dea93b5d5167618a5
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Mon Aug 18 11:51:45 2014 +0200

    Update phase progress: Check if callback is defined.
---
 csync/src/csync_owncloud.c                    |  5 ++++-
 csync/src/csync_owncloud_recursive_propfind.c | 12 +++++++++---
 csync/src/vio/csync_vio.c                     |  4 +++-
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/csync/src/csync_owncloud.c b/csync/src/csync_owncloud.c
index 860d25e..cc009c9 100644
--- a/csync/src/csync_owncloud.c
+++ b/csync/src/csync_owncloud.c
@@ -541,7 +541,10 @@ static struct listdir_context *fetch_resource_list(csync_owncloud_ctx_t *ctx, co
         }
     }
 
-    ctx->csync_ctx->callbacks.update_callback(false, curi, ctx->csync_ctx->callbacks.update_callback_userdata);
+    if( ctx->csync_ctx->callbacks.update_callback ) {
+	ctx->csync_ctx->callbacks.update_callback(false, curi, 
+              ctx->csync_ctx->callbacks.update_callback_userdata);
+    }
 
     fetchCtx = c_malloc( sizeof( struct listdir_context ));
     if (!fetchCtx) {
diff --git a/csync/src/csync_owncloud_recursive_propfind.c b/csync/src/csync_owncloud_recursive_propfind.c
index f3e6699..b84dbde 100644
--- a/csync/src/csync_owncloud_recursive_propfind.c
+++ b/csync/src/csync_owncloud_recursive_propfind.c
@@ -54,7 +54,9 @@ struct listdir_context *get_listdir_context_from_recursive_cache(csync_owncloud_
         DEBUG_WEBDAV("get_listdir_context_from_recursive_cache No element %s in cache found", curi);
         return NULL;
     }
-    ctx->csync_ctx->callbacks.update_callback(false, curi, ctx->csync_ctx->callbacks.update_callback_userdata);
+    if( ctx->csync_ctx->callbacks.update_callback ) {
+        ctx->csync_ctx->callbacks.update_callback(false, curi, ctx->csync_ctx->callbacks.update_callback_userdata);
+    }
 
     /* Out of the element, create a listdir_context.. if we could be sure that it is immutable, we could ref instead.. need to investigate */
     fetchCtx = c_malloc( sizeof( struct listdir_context ));
@@ -147,7 +149,9 @@ static void propfind_results_recursive_callback(void *userdata,
             // a recursive PROPFIND might take some time but we still want to
             // be informed. Later when get_listdir_context_from_recursive_cache is
             // called the DB queries might be the problem causing slowness, so do it again there then.
-            ctx->csync_ctx->callbacks.update_callback(false, path, ctx->csync_ctx->callbacks.update_callback_userdata);
+            if( ctx->csync_ctx->callbacks.update_callback ) {
+		ctx->csync_ctx->callbacks.update_callback(false, path, ctx->csync_ctx->callbacks.update_callback_userdata);
+	    }
         }
     }
 
@@ -196,7 +200,9 @@ void fetch_resource_list_recursive(csync_owncloud_ctx_t *ctx, const char *uri, c
     int depth = NE_DEPTH_INFINITE;
 
     DEBUG_WEBDAV("fetch_resource_list_recursive Starting recursive propfind %s %s", uri, curi);
-    ctx->csync_ctx->callbacks.update_callback(false, curi, ctx->csync_ctx->callbacks.update_callback_userdata);
+    if( ctx->csync_ctx->callbacks.update_callback ) {
+	ctx->csync_ctx->callbacks.update_callback(false, curi, ctx->csync_ctx->callbacks.update_callback_userdata);
+    }
 
     /* do a propfind request and parse the results in the results function, set as callback */
     hdl = ne_propfind_create(ctx->dav_session.ctx, curi, depth);
diff --git a/csync/src/vio/csync_vio.c b/csync/src/vio/csync_vio.c
index ae658dc..4eb17bc 100644
--- a/csync/src/vio/csync_vio.c
+++ b/csync/src/vio/csync_vio.c
@@ -48,7 +48,9 @@ csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name) {
       return owncloud_opendir(ctx, name);
       break;
     case LOCAL_REPLICA:
-      ctx->callbacks.update_callback(ctx->replica, name, ctx->callbacks.update_callback_userdata);
+	if( ctx->callbacks.update_callback ) {
+	  ctx->callbacks.update_callback(ctx->replica, name, ctx->callbacks.update_callback_userdata);
+	}
       return csync_vio_local_opendir(name);
       break;
     default:

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