Sun, 14 Apr 2019 16:28:36 +0200
add link target to sync db
dav/db.c | file | annotate | diff | comparison | revisions | |
dav/db.h | file | annotate | diff | comparison | revisions |
--- a/dav/db.c Sat Apr 13 16:51:22 2019 +0200 +++ b/dav/db.c Sun Apr 14 16:28:36 2019 +0200 @@ -213,6 +213,8 @@ field = 10; } else if(xstreq(name, "hash")) { field = 11; + } else if(xstreq(name, "link")) { + field = 12; } else if(xstreq(name, "skipped")) { res->skipped = TRUE; } else if(xstreq(name, "tags-updated")) { @@ -308,6 +310,10 @@ res->hash = strdup((char*)value); break; } + case 12: { + res->link_target = strdup((char*)value); + break; + } } } else if(XML_READER_TYPE_END_ELEMENT) { if(xstreq(name, "resource")) { @@ -515,6 +521,18 @@ } } + if(res->link_target) { + r = xmlTextWriterWriteElement( + writer, + BAD_CAST "link", + BAD_CAST res->link_target); + if(r < 0) { + fprintf(stderr, "Cannot write link: %s\n", res->link_target); + xmlFreeTextWriter(writer); + return -1; + } + } + if(res->xattr_hash) { r = xmlTextWriterWriteElement( writer,