[Pkg-owncloud-commits] [ocsync] 13/29: Do not 'normalize' etag when we read from db

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Dec 13 14:26:34 UTC 2013


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository ocsync.

commit ba8fa9a403f8195159016bd6f97b675bceb899ff
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Dec 11 12:50:45 2013 +0100

    Do not 'normalize' etag when we read from db
    
    Normalize removes the quote and the -gzip.
    We assume that the normalized etag is in the DB
    This is how it worked in mirall 1.4
    
    We added normalization in case there is a -gzip saved to the database.
    But since this was broken in 1.4 anyway, it will just force a
    re-download if -gzip was added. (1.4 anyway is broken with such
    server and always do redownload all the time)
---
 src/csync_dbtree.c  | 2 +-
 src/csync_statedb.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/csync_dbtree.c b/src/csync_dbtree.c
index 9dc9642..930920c 100644
--- a/src/csync_dbtree.c
+++ b/src/csync_dbtree.c
@@ -178,7 +178,7 @@ csync_vio_method_handle_t *csync_dbtree_opendir(CSYNC *ctx, const char *name)
         fs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_TYPE;
 
         column = list->vector[base+8]; /* etag */
-        fs->etag = csync_normalize_etag(column);
+        fs->etag = c_strdup(column);
         fs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_ETAG;
 
         column = list->vector[base+9]; /* file id */
diff --git a/src/csync_statedb.c b/src/csync_statedb.c
index 5df2bd5..f626d27 100644
--- a/src/csync_statedb.c
+++ b/src/csync_statedb.c
@@ -392,7 +392,7 @@ csync_file_stat_t *csync_statedb_get_stat_by_hash(sqlite3 *db,
       }
 
       if(column_count > 9 && sqlite3_column_text(_by_hash_stmt, 9)) {
-        st->etag = csync_normalize_etag( (char*) sqlite3_column_text(_by_hash_stmt, 9) );
+        st->etag = c_strdup( (char*) sqlite3_column_text(_by_hash_stmt, 9) );
       }
       if(column_count > 10 && sqlite3_column_text(_by_hash_stmt,10)) {
           csync_vio_set_file_id(st->file_id, (char*) sqlite3_column_text(_by_hash_stmt, 10));
@@ -464,7 +464,7 @@ csync_file_stat_t *csync_statedb_get_stat_by_file_id( sqlite3 *db,
    st->modtime  = strtoul(result->vector[7], NULL, 10);
    st->type     = atoi(result->vector[8]);
    if( result->vector[9] )
-     st->etag = csync_normalize_etag(result->vector[9]);
+     st->etag = c_strdup(result->vector[9]);
 
    csync_vio_set_file_id(st->file_id, file_id);
 
@@ -523,7 +523,7 @@ csync_file_stat_t *csync_statedb_get_stat_by_inode(sqlite3 *db,
   st->modtime = strtoul(result->vector[7], NULL, 10);
   st->type = atoi(result->vector[8]);
   if( result->vector[9] )
-    st->etag = csync_normalize_etag(result->vector[9]);
+    st->etag = c_strdup(result->vector[9]);
   csync_vio_set_file_id( st->file_id, result->vector[10]);
 
   c_strlist_destroy(result);
@@ -550,7 +550,7 @@ char *csync_statedb_get_uniqId( CSYNC *ctx, uint64_t jHash, csync_vio_file_stat_
     }
 
     if (result->count == 2) {
-        ret = csync_normalize_etag( result->vector[0] );
+        ret = c_strdup( result->vector[0] );
         csync_vio_file_stat_set_file_id(buf, result->vector[1]);
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/ocsync.git



More information about the Pkg-owncloud-commits mailing list