From 1ed01e1bcc929d363ad5f3c4d2cf262a20134412 Mon Sep 17 00:00:00 2001 From: Giuseppe Castagno Date: Tue, 16 Aug 2016 11:02:59 +0200 Subject: 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 Reviewed-by: Giuseppe Castagno --- ucb/source/ucp/webdav-neon/webdavcontent.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ucb') diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 55cbd83957b9..daae5fcda8f6 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 } -- cgit