Update phase progress: Check if callback is defined.

This commit is contained in:
Klaas Freitag 2014-08-18 11:51:45 +02:00
Родитель 27f9d4523b
Коммит ddbe181e48
3 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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;
}
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,9 +149,11 @@ 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.
if( ctx->csync_ctx->callbacks.update_callback ) {
ctx->csync_ctx->callbacks.update_callback(false, path, ctx->csync_ctx->callbacks.update_callback_userdata);
}
}
}
/* Check for parent in tree. If exists: Insert it into the children elements there */
parentPath = ne_path_parent(uri->path);
@ -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);
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);

Просмотреть файл

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