[Pkg-owncloud-commits] [owncloud-client] 83/333: csync: Remove capabilities

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:16:37 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 e7fb84a4916fed0c9cb3adf62e6171113614ec7a
Author: Markus Goetz <markus at woboq.com>
Date:   Thu Feb 27 13:42:20 2014 +0100

    csync: Remove capabilities
---
 csync/src/csync_owncloud.c       | 13 -------------
 csync/src/csync_private.h        |  1 -
 csync/src/vio/csync_vio.c        | 33 ---------------------------------
 csync/src/vio/csync_vio_method.h | 14 --------------
 4 files changed, 61 deletions(-)

diff --git a/csync/src/csync_owncloud.c b/csync/src/csync_owncloud.c
index 1eceaeb..bcfb98e 100644
--- a/csync/src/csync_owncloud.c
+++ b/csync/src/csync_owncloud.c
@@ -891,18 +891,6 @@ static int owncloud_stat(const char *uri, csync_vio_file_stat_t *buf) {
     return 0;
 }
 
-/* capabilities are currently:
- *  bool atomar_copy_support - oC provides atomar copy
- *  bool do_post_copy_stat   - oC does not want the post copy check
- *  bool propagate_on_fd     - oC supports the send_file method.
- */
-static csync_vio_capabilities_t _owncloud_capabilities = { true, false, true, false, false };
-
-static csync_vio_capabilities_t *owncloud_capabilities(void)
-{
-  return &_owncloud_capabilities;
-}
-
 static const char* owncloud_get_etag( const char *path )
 {
     ne_request *req    = NULL;
@@ -1157,7 +1145,6 @@ static int owncloud_set_property(const char *key, void *data) {
 
 csync_vio_method_t _method = {
     .method_table_size = sizeof(csync_vio_method_t),
-    .get_capabilities = owncloud_capabilities,
     .get_etag = owncloud_get_etag,
     .open = 0,
     .creat = 0,
diff --git a/csync/src/csync_private.h b/csync/src/csync_private.h
index 368bcef..f8a779d 100644
--- a/csync/src/csync_private.h
+++ b/csync/src/csync_private.h
@@ -129,7 +129,6 @@ struct csync_s {
   struct {
     csync_vio_method_t *method;
     csync_vio_method_finish_fn finish_fn;
-    csync_vio_capabilities_t capabilities;
   } module;
 
   struct {
diff --git a/csync/src/vio/csync_vio.c b/csync/src/vio/csync_vio.c
index 04d2b42..d2147c8 100644
--- a/csync/src/vio/csync_vio.c
+++ b/csync/src/vio/csync_vio.c
@@ -70,27 +70,6 @@ int csync_vio_init(CSYNC *ctx, const char *module, const char *args) {
     return -1;
   }
 
-  /* Useful defaults to the module capabilities */
-  ctx->module.capabilities.atomar_copy_support = false;
-  ctx->module.capabilities.do_post_copy_stat   = true;
-  ctx->module.capabilities.use_send_file_to_propagate = false; /* do use read/write by default */
-
-  /* Load the module capabilities from the module if it implements the it. */
-  if( VIO_METHOD_HAS_FUNC(m, get_capabilities)) {
-    ctx->module.capabilities = *(m->get_capabilities());
-  }
-
-  CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "capabilities: atomar copy support: %s",
-            ctx->module.capabilities.atomar_copy_support ? "yes": "no");
-  CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "capabilities: post copy stat: %s",
-            ctx->module.capabilities.do_post_copy_stat ? "yes": "no");
-  CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "capabilities: use send_file: %s",
-            ctx->module.capabilities.use_send_file_to_propagate ? "yes" : "no" );
-  CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "capabilities: get support: %s",
-            ctx->module.capabilities.get_support ? "yes" : "no" );
-  CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "capabilities: put support: %s",
-            ctx->module.capabilities.put_support? "yes" : "no" );
-
   /* Some basic checks */
   if (m->method_table_size == 0) {
     CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "module %s method table size is 0", module);
@@ -102,18 +81,6 @@ int csync_vio_init(CSYNC *ctx, const char *module, const char *args) {
     return -1;
   }
 
-  /* Useful defaults to the module capabilities */
-  ctx->module.capabilities.atomar_copy_support = false;
-  ctx->module.capabilities.put_support         = false;
-  ctx->module.capabilities.get_support         = false;
-
-  /* Load the module capabilities from the module if it implements the it. */
-  if( VIO_METHOD_HAS_FUNC(m, get_capabilities)) {
-    ctx->module.capabilities = *(m->get_capabilities());
-  } else {
-    CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "module %s has no capabilities fn", module);
-  }
-
   if (! VIO_METHOD_HAS_FUNC(m, get_etag)) {
     CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "module %s has no get_etag fn", module);
   }
diff --git a/csync/src/vio/csync_vio_method.h b/csync/src/vio/csync_vio_method.h
index f7cd198..9783144 100644
--- a/csync/src/vio/csync_vio_method.h
+++ b/csync/src/vio/csync_vio_method.h
@@ -33,23 +33,10 @@
 
 typedef struct csync_vio_method_s csync_vio_method_t;
 
-/* module capabilities definition.
- * remember to set useful defaults in csync_vio.c if you add something here. */
-struct csync_vio_capabilities_s {
- bool atomar_copy_support; /* set to true if the backend provides atomar copy */
- bool do_post_copy_stat;   /* true if csync should check the copy afterwards  */
- bool use_send_file_to_propagate; /* if set, the module rather copies files using send_file than read and write */
- bool get_support;
- bool put_support;
-};
-
-typedef struct csync_vio_capabilities_s csync_vio_capabilities_t;
-
 typedef csync_vio_method_t *(*csync_vio_method_init_fn)(const char *method_name,
     const char *config_args, csync_auth_callback cb, void *userdata);
 typedef void (*csync_vio_method_finish_fn)(csync_vio_method_t *method);
 
-typedef csync_vio_capabilities_t *(*csync_method_get_capabilities_fn)(void);
 typedef const char* (*csync_method_get_etag_fn)(const char* path);
 typedef csync_vio_method_handle_t *(*csync_method_open_fn)(const char *durl, int flags, mode_t mode);
 typedef csync_vio_method_handle_t *(*csync_method_creat_fn)(const char *durl, mode_t mode);
@@ -90,7 +77,6 @@ typedef int (*csync_method_put_fn)(csync_vio_method_handle_t *flocal,
 
 struct csync_vio_method_s {
   size_t method_table_size;           /* Used for versioning */
-  csync_method_get_capabilities_fn get_capabilities;
   csync_method_open_fn open;
   csync_method_creat_fn creat;
   csync_method_close_fn close;

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