Quellcode durchsuchen

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)
Olivier Goffart vor 12 Jahren
Ursprung
Commit
ba8fa9a403
2 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen
  1. 1 1
      src/csync_dbtree.c
  2. 4 4
      src/csync_statedb.c

+ 1 - 1
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 */

+ 4 - 4
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]);
     }