summaryrefslogtreecommitdiff
path: root/ucb/source/ucp
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-08-10 14:05:08 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-01 18:41:51 +0100
commitccbb358db241b8b2564f3d5ac2991ffff5d3deeb (patch)
tree02cfef6afb35964ee9c72cbccbb9755c79dfd6d3 /ucb/source/ucp
parenta10851aca6e14a00b892c78d1cc51476547acf29 (diff)
ucb: webdav-curl: tdf#101094 (21): Simplify cache removal: LOCK, UNLOCK
[ port of commit 508f78298833f45fd9e2e789aa26cca125719baf ] Change-Id: I81185c11ed3ad216b13fcbafee45ea3a48cf0a12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123474 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb/source/ucp')
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontent.cxx21
1 files changed, 4 insertions, 17 deletions
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index 46442074d8b2..212c8732b91e 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -3116,8 +3116,6 @@ void Content::lock(
aURL = m_xIdentifier->getContentIdentifier();
}
- OUString aTargetUrl = aURL;
-
try
{
std::unique_ptr< DAVResourceAccess > xResAccess;
@@ -3139,12 +3137,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 );
@@ -3153,7 +3148,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
@@ -3253,8 +3247,6 @@ void Content::lock(
void Content::unlock(
const uno::Reference< ucb::XCommandEnvironment >& Environment )
{
- // save the URL to clean cache
- OUString aTargetUrl = m_xIdentifier->getContentIdentifier();
try
{
@@ -3264,8 +3256,6 @@ void Content::unlock(
xResAccess.reset( new DAVResourceAccess( *m_xResAccess ) );
}
- // update the URL
- aTargetUrl = xResAccess->getURL();
// check if the target URL is a Class1 DAV
DAVOptions aDAVOptions;
getResourceOptions( Environment, aDAVOptions, xResAccess );
@@ -3273,10 +3263,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 );
}
{
@@ -3316,9 +3306,6 @@ void Content::unlock(
}
break;
default:
- // remove options from cache,
- // it will be refreshed when needed
- aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
//fallthrough
;
}