add check to detect changed link properties in dav-sync pull

Sun, 21 Apr 2019 09:41:05 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 21 Apr 2019 09:41:05 +0200
changeset 579
c80d5730c00b
parent 578
bb1e60fada74
child 580
caf23cf7f96d

add check to detect changed link properties in dav-sync pull

dav/sync.c file | annotate | diff | comparison | revisions
--- a/dav/sync.c	Sat Apr 20 18:46:00 2019 +0200
+++ b/dav/sync.c	Sun Apr 21 09:41:05 2019 +0200
@@ -598,6 +598,7 @@
     UcxList *res_modified = NULL;
     UcxList *res_new = NULL;
     UcxList *res_moved = NULL; // type: MovedFile
+    UcxList *res_link;
     UcxList *res_conflict = NULL;
     UcxList *res_mkdir = NULL;
     UcxList *res_metadata = NULL;
@@ -970,8 +971,11 @@
     } else if(local) {
         DavBool nochange = FALSE;
         char *content_hash = sync_get_content_hash(res);
+        char *link = dav_get_string_property_ns(res, DAV_NS, "link");
         
-        if(content_hash && local->hash) {
+        if(nullstrcmp(link, local->link_target)) {
+            ret = REMOTE_CHANGE_MODIFIED;
+        } else if(content_hash && local->hash) {
             if(!strcmp(content_hash, local->hash)) {
                 nochange = TRUE;
             }

mercurial