Use csync_normalize_etag everywhere.

Technically, we don't need to strip '-gzip' from the etag comming from
the propfind, but it is better to be consistant.
This commit is contained in:
Olivier Goffart 2013-12-11 11:35:55 +01:00
parent bdf36f58a8
commit 1b4e2becb3
4 changed files with 3 additions and 17 deletions

View File

@ -264,7 +264,6 @@ CSYNC_STATUS csync_errno_to_status(int error, CSYNC_STATUS default_status)
/* Remove possible quotes, and also the -gzip at the end
* Remove "-gzip" at the end (cf. https://github.com/owncloud/mirall/issues/1195)
* The caller must take ownership of the resulting string.
* (work in place)
*/
char *csync_normalize_etag(const char *etag)
{

View File

@ -621,13 +621,7 @@ static void results(void *userdata,
}
if( md5sum ) {
int len = strlen(md5sum)-2;
if( len > 0 ) {
/* Skip the " around the string coming back from the ne_propset_value call */
newres->md5 = c_malloc(len+1);
strncpy( newres->md5, md5sum+1, len );
newres->md5[len] = '\0';
}
newres->md5 = csync_normalize_etag(md5sum);
}
csync_vio_set_file_id(newres->file_id, file_id);

View File

@ -185,13 +185,7 @@ static void propfind_results_recursive(void *userdata,
}
if( md5sum ) {
int len = strlen(md5sum)-2;
if( len > 0 ) {
/* Skip the " around the string coming back from the ne_propset_value call */
newres->md5 = c_malloc(len+1);
strncpy( newres->md5, md5sum+1, len );
newres->md5[len] = '\0';
}
newres->md5 = csync_normalize_etag(md5sum);
}
csync_vio_set_file_id(newres->file_id, file_id);

View File

@ -550,8 +550,7 @@ char *csync_statedb_get_uniqId( CSYNC *ctx, uint64_t jHash, csync_vio_file_stat_
}
if (result->count == 2) {
/* phash, pathlen, path, inode, uid, gid, mode, modtime */
ret = c_strdup( result->vector[0] );
ret = csync_normalize_etag( result->vector[0] );
csync_vio_file_stat_set_file_id(buf, result->vector[1]);
}