[Libreoffice-commits] core.git: ucb/source

Giuseppe Castagno giuseppe.castagno at acca-esse.eu
Tue Aug 16 10:40:27 UTC 2016


 ucb/source/ucp/webdav-neon/webdavcontent.cxx |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 1ed01e1bcc929d363ad5f3c4d2cf262a20134412
Author: Giuseppe Castagno <giuseppe.castagno at acca-esse.eu>
Date:   Tue Aug 16 11:02:59 2016 +0200

    tdf#101094 (24): Simplify cache removal: DESTROY, PROPPATCH, MOVE
    
    Plus another PUT forgotten on a previuos commit.
    
    Change-Id: I9e15cae2e858884cfd4c827ae767a2c5fcef1782
    Reviewed-on: https://gerrit.libreoffice.org/28158
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Giuseppe Castagno <giuseppe.castagno at acca-esse.eu>

diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index 55cbd83..daae5fc 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -566,6 +566,7 @@ uno::Any SAL_CALL Content::execute(
                 osl::Guard< osl::Mutex > aGuard( m_aMutex );
                 xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
             }
+            aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
             xResAccess->DESTROY( Environment );
             {
                 osl::Guard< osl::Mutex > aGuard( m_aMutex );
@@ -853,6 +854,7 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg,
             osl::Guard< osl::Mutex > aGuard( m_aMutex );
             xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
         }
+        aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
         xResAccess->PROPPATCH( aProppatchValues, xEnv );
         {
             osl::Guard< osl::Mutex > aGuard( m_aMutex );
@@ -945,6 +947,7 @@ void Content::removeProperty( const OUString& Name,
             osl::Guard< osl::Mutex > aGuard( m_aMutex );
             xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
         }
+        aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
         xResAccess->PROPPATCH( aProppatchValues, xEnv );
         {
             osl::Guard< osl::Mutex > aGuard( m_aMutex );
@@ -1870,6 +1873,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
         try
         {
             // Set property values at server.
+            aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
             xResAccess->PROPPATCH( aProppatchValues, xEnv );
             // TODO PLACEHOLDER:
             // remove target URL options from cache, since PROPPATCH may change it
@@ -1919,10 +1923,10 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
         {
             targetURI.SetScheme( sourceURI.GetScheme() );
 
-            xResAccess->MOVE(
-                sourceURI.GetPath(), targetURI.GetURI(), false, xEnv );
             aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
             aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
+            xResAccess->MOVE(
+                sourceURI.GetPath(), targetURI.GetURI(), false, xEnv );
 
             // @@@ Should check for resources that could not be moved
             //     (due to source access or target overwrite) and send
@@ -1957,8 +1961,6 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
         }
         catch ( DAVException const & e )
         {
-            aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
-            aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
             // Do not set new title!
             aNewTitle.clear();
 
@@ -2588,14 +2590,13 @@ void Content::insert(
         OUString    aTargetUrl = xResAccess->getURL();
         try
         {
-            xResAccess->PUT( xInputStream, Environment );
             // remove options from cache, PUT may change it
             // it will be refreshed when needed
             aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
+            xResAccess->PUT( xInputStream, Environment );
         }
         catch ( DAVException const & e )
         {
-            aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
             cancelCommandExecution( e, Environment, true );
             // Unreachable
         }


More information about the Libreoffice-commits mailing list