ucb/source/ucp/webdav-curl/webdavresponseparser.cxx |   21 +++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 3f2c3acfac2c699820f1a7e66a485ad98d5d92ab
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Oct 21 21:08:38 2021 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 1 18:55:22 2021 +0100

    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 <michael.st...@allotropia.de>

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

Reply via email to