Initial sync-token and sync-collection support

Use the etag of the collection as the sync token and tell the client that the token is invalid when the collection changed.
This commit is contained in:
Unrud
2017-06-02 12:44:23 +02:00
parent 6bb0e9d956
commit f2b415c4a6
3 changed files with 49 additions and 5 deletions

View File

@ -821,7 +821,8 @@ class Application:
else:
collection = item.collection
headers = {"Content-Type": "text/xml; charset=%s" % self.encoding}
xml_answer = xmlutils.report(
status, xml_answer = xmlutils.report(
base_prefix, path, xml_content, collection)
return (client.MULTI_STATUS, headers,
self._write_xml_content(xml_answer))
if status == client.PRECONDITION_FAILED:
return PRECONDITION_FAILED
return (status, headers, self._write_xml_content(xml_answer))