Kaydet (Commit) 1ed01e1b authored tarafından Giuseppe Castagno's avatar Giuseppe Castagno

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/28158Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>
üst 174c064b
...@@ -566,6 +566,7 @@ uno::Any SAL_CALL Content::execute( ...@@ -566,6 +566,7 @@ uno::Any SAL_CALL Content::execute(
osl::Guard< osl::Mutex > aGuard( m_aMutex ); osl::Guard< osl::Mutex > aGuard( m_aMutex );
xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
} }
aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
xResAccess->DESTROY( Environment ); xResAccess->DESTROY( Environment );
{ {
osl::Guard< osl::Mutex > aGuard( m_aMutex ); osl::Guard< osl::Mutex > aGuard( m_aMutex );
...@@ -853,6 +854,7 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg, ...@@ -853,6 +854,7 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg,
osl::Guard< osl::Mutex > aGuard( m_aMutex ); osl::Guard< osl::Mutex > aGuard( m_aMutex );
xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
} }
aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
xResAccess->PROPPATCH( aProppatchValues, xEnv ); xResAccess->PROPPATCH( aProppatchValues, xEnv );
{ {
osl::Guard< osl::Mutex > aGuard( m_aMutex ); osl::Guard< osl::Mutex > aGuard( m_aMutex );
...@@ -945,6 +947,7 @@ void Content::removeProperty( const OUString& Name, ...@@ -945,6 +947,7 @@ void Content::removeProperty( const OUString& Name,
osl::Guard< osl::Mutex > aGuard( m_aMutex ); osl::Guard< osl::Mutex > aGuard( m_aMutex );
xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
} }
aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
xResAccess->PROPPATCH( aProppatchValues, xEnv ); xResAccess->PROPPATCH( aProppatchValues, xEnv );
{ {
osl::Guard< osl::Mutex > aGuard( m_aMutex ); osl::Guard< osl::Mutex > aGuard( m_aMutex );
...@@ -1870,6 +1873,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( ...@@ -1870,6 +1873,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
try try
{ {
// Set property values at server. // Set property values at server.
aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
xResAccess->PROPPATCH( aProppatchValues, xEnv ); xResAccess->PROPPATCH( aProppatchValues, xEnv );
// TODO PLACEHOLDER: // TODO PLACEHOLDER:
// remove target URL options from cache, since PROPPATCH may change it // remove target URL options from cache, since PROPPATCH may change it
...@@ -1919,10 +1923,10 @@ uno::Sequence< uno::Any > Content::setPropertyValues( ...@@ -1919,10 +1923,10 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
{ {
targetURI.SetScheme( sourceURI.GetScheme() ); targetURI.SetScheme( sourceURI.GetScheme() );
xResAccess->MOVE(
sourceURI.GetPath(), targetURI.GetURI(), false, xEnv );
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() ); aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() ); aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
xResAccess->MOVE(
sourceURI.GetPath(), targetURI.GetURI(), false, xEnv );
// @@@ Should check for resources that could not be moved // @@@ Should check for resources that could not be moved
// (due to source access or target overwrite) and send // (due to source access or target overwrite) and send
...@@ -1957,8 +1961,6 @@ uno::Sequence< uno::Any > Content::setPropertyValues( ...@@ -1957,8 +1961,6 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
} }
catch ( DAVException const & e ) catch ( DAVException const & e )
{ {
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
// Do not set new title! // Do not set new title!
aNewTitle.clear(); aNewTitle.clear();
...@@ -2588,14 +2590,13 @@ void Content::insert( ...@@ -2588,14 +2590,13 @@ void Content::insert(
OUString aTargetUrl = xResAccess->getURL(); OUString aTargetUrl = xResAccess->getURL();
try try
{ {
xResAccess->PUT( xInputStream, Environment );
// remove options from cache, PUT may change it // remove options from cache, PUT may change it
// it will be refreshed when needed // it will be refreshed when needed
aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl ); aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
xResAccess->PUT( xInputStream, Environment );
} }
catch ( DAVException const & e ) catch ( DAVException const & e )
{ {
aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
cancelCommandExecution( e, Environment, true ); cancelCommandExecution( e, Environment, true );
// Unreachable // Unreachable
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment