From 3f2c3acfac2c699820f1a7e66a485ad98d5d92ab Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 21 Oct 2021 21:08:38 +0200 Subject: ucb: webdav-curl: handle "depth" in WebDAVResponseParser Also remove a spurious fall-through that probably doesn't matter in practice because the "status" element follows the "prop" element that contains "activelock" in the schema so at that time maStatus should always be empty for a valid response. Change-Id: If4cc8dbc75391d76ff497b83dd0f7fd00eb34a33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124076 Tested-by: Jenkins Reviewed-by: Michael Stahl --- ucb/source/ucp/webdav-curl/webdavresponseparser.cxx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'ucb') diff --git a/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx b/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx index 1c24d63200a3..4b6d0f848b66 100644 --- a/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx +++ b/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx @@ -80,6 +80,7 @@ namespace WebDAVName_supportedlock, WebDAVName_lockentry, WebDAVName_lockscope, + WebDAVName_depth, WebDAVName_locktoken, WebDAVName_exclusive, WebDAVName_locktype, @@ -115,6 +116,7 @@ namespace aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("supportedlock"), WebDAVName_supportedlock)); aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("lockentry"), WebDAVName_lockentry)); aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("lockscope"), WebDAVName_lockscope)); + aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("depth"), WebDAVName_depth)); aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("locktoken"), WebDAVName_locktoken)); aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("exclusive"), WebDAVName_exclusive)); aWebDAVNameMapperList.insert(WebDAVNameValueType(OUString("locktype"), WebDAVName_locktype)); @@ -705,13 +707,30 @@ namespace } break; } + case WebDAVName_depth: + { + OUString const chars(mpContext->getWhiteSpace()); + if (chars == "0") + { + maLock.Depth = ucb::LockDepth_ZERO; + } + else if (chars == "1") + { + maLock.Depth = ucb::LockDepth_ONE; + } + else if (chars == "infinity") + { + maLock.Depth = ucb::LockDepth_INFINITY; + } + break; + } case WebDAVName_activelock: { maLock.Type = maLockType; maLock.Scope = maLockScope; maResult_Lock.push_back(maLock); + break; } - [[fallthrough]]; // I hope intentional? case WebDAVName_propstat: { // propstat end, check status -- cgit