2747 res->remote_tags_hash = strdup(db_res->remote_tags_hash); |
2747 res->remote_tags_hash = strdup(db_res->remote_tags_hash); |
2748 } |
2748 } |
2749 if(db_res->xattr_hash) { |
2749 if(db_res->xattr_hash) { |
2750 res->xattr_hash = strdup(db_res->xattr_hash); |
2750 res->xattr_hash = strdup(db_res->xattr_hash); |
2751 } |
2751 } |
|
2752 if(db_res->hash) { |
|
2753 res->prev_hash = strdup(db_res->hash); |
|
2754 } |
2752 |
2755 |
2753 // if the resource is splitted, move the part infos to the new |
2756 // if the resource is splitted, move the part infos to the new |
2754 // LocalResource obj, because we need it later |
2757 // LocalResource obj, because we need it later |
2755 if(db_res->parts) { |
2758 if(db_res->parts) { |
2756 res->parts = db_res->parts; |
2759 res->parts = db_res->parts; |
2883 |
2886 |
2884 int ret = 0; |
2887 int ret = 0; |
2885 if(err == 0) { |
2888 if(err == 0) { |
2886 char *etag = dav_get_string_property(remote, "D:getetag"); |
2889 char *etag = dav_get_string_property(remote, "D:getetag"); |
2887 char *hash = sync_get_content_hash(remote); |
2890 char *hash = sync_get_content_hash(remote); |
2888 if(hash && res->hash) { |
2891 if(hash && res->prev_hash) { |
2889 if(strcmp(hash, res->hash)) { |
2892 if(strcmp(hash, res->prev_hash)) { |
2890 ret = 1; |
2893 ret = 1; |
2891 } |
2894 } |
2892 } else if(!res->etag) { |
2895 } else if(!res->etag) { |
2893 // the resource is on the server and the client has no etag |
2896 // the resource is on the server and the client has no etag |
2894 ret = 1; |
2897 ret = 1; |