[Pkg-owncloud-commits] [owncloud-client] 86/333: csync: Remove get_etag

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 5d58a8164c0f8943ed14067a3fa055e432e4fb44
Author: Markus Goetz <markus at woboq.com>
Date:   Thu Feb 27 14:03:17 2014 +0100

    csync: Remove get_etag
---
 csync/src/csync_owncloud.c       | 63 ----------------------------------------
 csync/src/vio/csync_vio.c        | 15 ----------
 csync/src/vio/csync_vio.h        |  1 -
 csync/src/vio/csync_vio_local.h  |  2 --
 csync/src/vio/csync_vio_method.h |  2 --
 5 files changed, 83 deletions(-)

diff --git a/csync/src/csync_owncloud.c b/csync/src/csync_owncloud.c
index 2ce333f..483d048 100644
--- a/csync/src/csync_owncloud.c
+++ b/csync/src/csync_owncloud.c
@@ -891,68 +891,6 @@ static int owncloud_stat(const char *uri, csync_vio_file_stat_t *buf) {
     return 0;
 }
 
-static const char* owncloud_get_etag( const char *path )
-{
-    ne_request *req    = NULL;
-    const char *header = NULL;
-    char *uri          = _cleanPath(path);
-    char *cbuf   = NULL;
-    csync_vio_file_stat_t *fs = NULL;
-    bool doHeadRequest = false;
-
-    if (_id_cache.uri && c_streq(path, _id_cache.uri)) {
-        header = _id_cache.id;
-    }
-
-    doHeadRequest= false; /* ownCloud server doesn't have good support for HEAD yet */
-
-    if( !header && doHeadRequest ) {
-        int neon_stat;
-        /* Perform an HEAD request to the resource. HEAD delivers the
-         * ETag header back. */
-        req = ne_request_create(dav_session.ctx, "HEAD", uri);
-        neon_stat = ne_request_dispatch(req);
-        set_errno_from_neon_errcode( neon_stat );
-
-        header = ne_get_response_header(req, "etag");
-    }
-    /* If the request went wrong or the server did not respond correctly
-     * (that can happen for collections) a stat call is done which translates
-     * into a PROPFIND request.
-     */
-    if( ! header ) {
-        /* ... and do a stat call. */
-        fs = csync_vio_file_stat_new();
-        if(fs == NULL) {
-            DEBUG_WEBDAV( "owncloud_get_etag: memory fault.");
-            errno = ENOMEM;
-            return NULL;
-        }
-        if( owncloud_stat( path, fs ) == 0 ) {
-            header = fs->etag;
-        }
-    }
-
-    /* In case the result is surrounded by "" cut them away. */
-    if( header ) {
-        cbuf = csync_normalize_etag(header);
-    }
-
-    /* fix server problem: If we end up with an empty string, set something strange... */
-    if( c_streq(cbuf, "") || c_streq(cbuf, "\"\"") ) {
-        SAFE_FREE(cbuf);
-        cbuf = c_strdup("empty_etag");
-    }
-
-    DEBUG_WEBDAV("Get file ID for %s: %s", path, cbuf ? cbuf:"<null>");
-    if( fs ) csync_vio_file_stat_destroy(fs);
-    if( req ) ne_request_destroy(req);
-    SAFE_FREE(uri);
-
-
-    return cbuf;
-}
-
 /*
  * directory functions
  */
@@ -1152,7 +1090,6 @@ csync_vio_method_t _method = {
     .set_property = owncloud_set_property,
     .get_error_string = owncloud_error_string,
     .commit = owncloud_commit,
-    .get_etag = owncloud_get_etag
 };
 
 csync_vio_method_t *vio_module_init(const char *method_name, const char *args,
diff --git a/csync/src/vio/csync_vio.c b/csync/src/vio/csync_vio.c
index 0d8760f..4617cfd 100644
--- a/csync/src/vio/csync_vio.c
+++ b/csync/src/vio/csync_vio.c
@@ -81,10 +81,6 @@ int csync_vio_init(CSYNC *ctx, const char *module, const char *args) {
     return -1;
   }
 
-  if (! VIO_METHOD_HAS_FUNC(m, get_etag)) {
-    CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "module %s has no get_etag fn", module);
-  }
-
   ctx->module.method = m;
 
   return 0;
@@ -178,17 +174,6 @@ csync_vio_file_stat_t *csync_vio_readdir(CSYNC *ctx, csync_vio_handle_t *dhandle
 }
 
 
-const char *csync_vio_get_etag(CSYNC *ctx, const char *path)
-{
-    const char *re = NULL;
-    /* We always use the remote method here. */
-    if(ctx->module.method &&
-            VIO_METHOD_HAS_FUNC(ctx->module.method, get_etag)) {
-        re = ctx->module.method->get_etag(path);
-    }
-    return re;
-}
-
 int csync_vio_stat(CSYNC *ctx, const char *uri, csync_vio_file_stat_t *buf) {
   int rc = -1;
 
diff --git a/csync/src/vio/csync_vio.h b/csync/src/vio/csync_vio.h
index a21fdc6..1356139 100644
--- a/csync/src/vio/csync_vio.h
+++ b/csync/src/vio/csync_vio.h
@@ -40,7 +40,6 @@ csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name);
 int csync_vio_closedir(CSYNC *ctx, csync_vio_handle_t *dhandle);
 csync_vio_file_stat_t *csync_vio_readdir(CSYNC *ctx, csync_vio_handle_t *dhandle);
 
-const char *csync_vio_get_etag(CSYNC *ctx, const char *path);
 int csync_vio_stat(CSYNC *ctx, const char *uri, csync_vio_file_stat_t *buf);
 
 int csync_vio_set_property(CSYNC *ctx, const char *key, void *data);
diff --git a/csync/src/vio/csync_vio_local.h b/csync/src/vio/csync_vio_local.h
index f8b770b..68f87d8 100644
--- a/csync/src/vio/csync_vio_local.h
+++ b/csync/src/vio/csync_vio_local.h
@@ -30,6 +30,4 @@ csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_method_handle_t *dhandl
 
 int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf);
 
-int csync_vio_local_utimes(const char *uri, const struct timeval *times);
-
 #endif /* _CSYNC_VIO_LOCAL_H */
diff --git a/csync/src/vio/csync_vio_method.h b/csync/src/vio/csync_vio_method.h
index 1410dbe..9aef7c1 100644
--- a/csync/src/vio/csync_vio_method.h
+++ b/csync/src/vio/csync_vio_method.h
@@ -37,7 +37,6 @@ 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 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);
 typedef int (*csync_method_close_fn)(csync_vio_method_handle_t *fhandle);
@@ -84,7 +83,6 @@ struct csync_vio_method_s {
   csync_method_set_property_fn set_property;
   csync_method_get_error_string_fn get_error_string;
   csync_method_commit_fn commit;
-  csync_method_get_etag_fn get_etag;
 };
 
 #endif /* _CSYNC_VIO_H */

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