[Pkg-owncloud-commits] [owncloud-client] 34/332: csync: remove the local mode
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu Aug 14 21:06:34 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 806ab8ea46ffab28ac3f28ed356415562381e868
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Tue Jun 3 17:52:07 2014 +0200
csync: remove the local mode
It is no longer used for a long time
---
csync/src/csync.c | 68 ++++++++++++-----------------------------------
csync/src/csync.h | 16 -----------
csync/src/csync_private.h | 1 -
3 files changed, 17 insertions(+), 68 deletions(-)
diff --git a/csync/src/csync.c b/csync/src/csync.c
index b0429de..0d2db65 100644
--- a/csync/src/csync.c
+++ b/csync/src/csync.c
@@ -129,7 +129,6 @@ int csync_create(CSYNC **csync, const char *local, const char *remote) {
}
ctx->status_code = CSYNC_STATUS_OK;
- ctx->options.local_only_mode = false;
ctx->pwd.uid = getuid();
ctx->pwd.euid = geteuid();
@@ -190,12 +189,8 @@ int csync_init(CSYNC *ctx) {
ctx->local.type = LOCAL_REPLICA;
- if ( !ctx->options.local_only_mode) {
- owncloud_init(ctx);
- ctx->remote.type = REMOTE_REPLICA;
- } else {
- ctx->remote.type = LOCAL_REPLICA;
- }
+ owncloud_init(ctx);
+ ctx->remote.type = REMOTE_REPLICA;
if (c_rbtree_create(&ctx->local.tree, _key_cmp, _data_cmp) < 0) {
ctx->status_code = CSYNC_STATUS_TREE_ERROR;
@@ -281,27 +276,25 @@ int csync_update(CSYNC *ctx) {
}
/* update detection for remote replica */
- if( ! ctx->options.local_only_mode ) {
- csync_gettime(&start);
- ctx->current = REMOTE_REPLICA;
- ctx->replica = ctx->remote.type;
+ csync_gettime(&start);
+ ctx->current = REMOTE_REPLICA;
+ ctx->replica = ctx->remote.type;
- rc = csync_ftw(ctx, ctx->remote.uri, csync_walker, MAX_DEPTH);
- if (rc < 0) {
- if(ctx->status_code == CSYNC_STATUS_OK)
- ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_UPDATE_ERROR);
- return -1;
- }
+ rc = csync_ftw(ctx, ctx->remote.uri, csync_walker, MAX_DEPTH);
+ if (rc < 0) {
+ if(ctx->status_code == CSYNC_STATUS_OK)
+ ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_UPDATE_ERROR);
+ return -1;
+ }
+ csync_gettime(&finish);
- csync_gettime(&finish);
+ CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
+ "Update detection for remote replica took %.2f seconds "
+ "walking %zu files.",
+ c_secdiff(finish, start), c_rbtree_size(ctx->remote.tree));
+ csync_memstat_check();
- CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
- "Update detection for remote replica took %.2f seconds "
- "walking %zu files.",
- c_secdiff(finish, start), c_rbtree_size(ctx->remote.tree));
- csync_memstat_check();
- }
ctx->status |= CSYNC_STATUS_UPDATE;
return 0;
@@ -843,33 +836,6 @@ CSYNC_STATUS csync_get_status(CSYNC *ctx) {
return ctx->status_code;
}
-int csync_set_local_only(CSYNC *ctx, bool local_only) {
- if (ctx == NULL) {
- return -1;
- }
-
- ctx->status_code = CSYNC_STATUS_OK;
-
- if (ctx->status & CSYNC_STATUS_INIT) {
- fprintf(stderr, "csync_set_local_only: This function must be called before initialization.");
- ctx->status_code = CSYNC_STATUS_CSYNC_STATUS_ERROR;
- return -1;
- }
-
- ctx->options.local_only_mode=local_only;
-
- return 0;
-}
-
-bool csync_get_local_only(CSYNC *ctx) {
- if (ctx == NULL) {
- return -1;
- }
- ctx->status_code = CSYNC_STATUS_OK;
-
- return ctx->options.local_only_mode;
-}
-
const char *csync_get_status_string(CSYNC *ctx)
{
return csync_vio_get_status_string(ctx);
diff --git a/csync/src/csync.h b/csync/src/csync.h
index a53980d..3987b15 100644
--- a/csync/src/csync.h
+++ b/csync/src/csync.h
@@ -492,22 +492,6 @@ int csync_set_log_userdata(void *data);
*/
const char *csync_get_statedb_file(CSYNC *ctx);
-/**
- * @brief Flag to tell csync that only a local run is intended. Call before csync_init
- *
- * @param local_only Bool flag to indicate local only mode.
- *
- * @return 0 on success, less than 0 if an error occured.
- */
-int csync_set_local_only( CSYNC *ctx, bool local_only );
-
-/**
- * @brief Retrieve the flag to tell csync that only a local run is intended.
- *
- * @return 1: stay local only, 0: local and remote mode
- */
-bool csync_get_local_only( CSYNC *ctx );
-
/* Used for special modes or debugging */
CSYNC_STATUS csync_get_status(CSYNC *ctx);
diff --git a/csync/src/csync_private.h b/csync/src/csync_private.h
index 526e21a..cd6c79b 100644
--- a/csync/src/csync_private.h
+++ b/csync/src/csync_private.h
@@ -121,7 +121,6 @@ struct csync_s {
struct {
int sync_symbolic_links;
char *config_dir;
- bool local_only_mode;
int timeout;
#if defined(HAVE_ICONV) && defined(WITH_ICONV)
iconv_t iconv_cd;
--
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