ucb/source/ucp/webdav-curl/webdavcontent.cxx |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit a10851aca6e14a00b892c78d1cc51476547acf29
Author:     Giuseppe Castagno <giuseppe.casta...@acca-esse.eu>
AuthorDate: Wed Aug 3 19:42:27 2016 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 1 18:41:25 2021 +0100

    ucb: webdav-curl: tdf#101094 (20) OPTIONS: Check for Class1 DAV before 
unlock
    
    [ port of commit d14977d33bc3edb6a2c41db4d685d099bfe8d51e ]
    
    Change-Id: I559d71f49e582af50ef88ea42beba48d38180134
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123473
    Tested-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx 
b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index de9cd6248a66..46442074d8b2 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -3266,10 +3266,18 @@ void Content::unlock(
 
         // update the URL
         aTargetUrl = xResAccess->getURL();
-        xResAccess->UNLOCK( Environment );
-        // remove options from cache, unlock may change it
-        // it will be refreshed when needed
-        aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
+        // check if the target URL is a Class1 DAV
+        DAVOptions aDAVOptions;
+        getResourceOptions( Environment, aDAVOptions, xResAccess );
+
+        // at least class one is needed
+        if( aDAVOptions.isClass1() )
+        {
+            xResAccess->UNLOCK( Environment );
+            // remove options from cache, unlock may change it
+            // it will be refreshed when needed
+            aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
+        }
 
         {
             osl::Guard< osl::Mutex > aGuard( m_aMutex );

Reply via email to