diff options
author | Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> | 2016-08-10 14:05:08 +0200 |
---|---|---|
committer | Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> | 2016-08-11 15:02:51 +0000 |
commit | 508f78298833f45fd9e2e789aa26cca125719baf (patch) | |
tree | f4ebb6f93ea4cca8ea2126dc0b0086f1cb89ec25 | |
parent | 1f2179bb313ad6cb9786a38412359c10b325a6b8 (diff) |
tdf#101094 (21): Simplify cache removal: LOCK, UNLOCK
Change-Id: Ib963fc6e0834606dcb6f42b3c0df5a408ebc5351
Reviewed-on: https://gerrit.libreoffice.org/28030
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu>
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index d86286b16116..e5cd7e4af959 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -3109,8 +3109,6 @@ void Content::lock( aURL = m_xIdentifier->getContentIdentifier(); } - OUString aTargetUrl = aURL; - try { std::unique_ptr< DAVResourceAccess > xResAccess; @@ -3132,12 +3130,9 @@ void Content::lock( //-1, // infinite lock uno::Sequence< OUString >() ); - // update the URL - aTargetUrl = xResAccess->getURL(); - + // OPTIONS may change as a consequence of the lock operation + aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() ); xResAccess->LOCK( aLock, Environment ); - // OPTIONS may have changed as a consequence of the lock operation - aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl ); { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -3146,7 +3141,6 @@ void Content::lock( } catch ( DAVException const & e ) { - aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl ); // check if the exception thrown is 'already locked' // this exception is mapped directly to the ucb correct one, without // going into the cancelCommandExecution() user interaction @@ -3247,8 +3241,6 @@ void Content::unlock( const uno::Reference< ucb::XCommandEnvironment >& Environment ) throw( uno::Exception, std::exception ) { - // save the URL to clean cache - OUString aTargetUrl = m_xIdentifier->getContentIdentifier(); try { @@ -3258,8 +3250,6 @@ void Content::unlock( xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); } - // update the URL - aTargetUrl = xResAccess->getURL(); // check if the target URL is a Class1 DAV DAVOptions aDAVOptions; getResourceOptions( Environment, aDAVOptions, xResAccess ); @@ -3267,10 +3257,10 @@ void Content::unlock( // 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 ); + aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() ); + xResAccess->UNLOCK( Environment ); } { @@ -3310,9 +3300,6 @@ void Content::unlock( } break; default: - // remove options from cache, - // it will be refreshed when needed - aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl ); //fallthrough ; } |