dav/sync.c

changeset 638
b3077bdb3d77
parent 633
b7de5ecc30fa
child 639
928a77ebe0b9
--- a/dav/sync.c	Wed Sep 04 19:28:10 2019 +0200
+++ b/dav/sync.c	Sat Sep 07 17:45:50 2019 +0200
@@ -2749,6 +2749,9 @@
         if(db_res->xattr_hash) {
             res->xattr_hash = strdup(db_res->xattr_hash);
         }
+        if(db_res->hash) {
+            res->prev_hash = strdup(db_res->hash);
+        }
         
         // if the resource is splitted, move the part infos to the new
         // LocalResource obj, because we need it later
@@ -2885,8 +2888,8 @@
     if(err == 0) {
         char *etag = dav_get_string_property(remote, "D:getetag");
         char *hash = sync_get_content_hash(remote);
-        if(hash && res->hash) {
-            if(strcmp(hash, res->hash)) {
+        if(hash && res->prev_hash) {
+            if(strcmp(hash, res->prev_hash)) {
                 ret = 1;
             }
         } else if(!res->etag) {

mercurial