summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-01-11 11:11:19 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-01 18:38:36 +0100
commitc155b4137678455294db605e0332b097ef51dc1a (patch)
treeffe7a7b07388723c43e2f4fd4b35b19bc1496f85
parentae8528e4b7c219411e4fa6f33fc693479bb5ce56 (diff)
ucb: webdav-curl: tdf#101094 (14) OPTIONS: Options cache removal: PUT
[ port of commit e0eb85785b68867f1476553723dbfc6dc407106b ] Change-Id: I2c4109b44ba291fdc01289b2706f746512d7e3e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123466 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontent.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index fdec5e34b4bc..cc7578a2ca49 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -2434,6 +2434,8 @@ void Content::insert(
aURL += aEscapedTitle;
+ // save the URL to clean cache
+ OUString aTargetUrl = aURL;
try
{
xResAccess->setURL( aURL );
@@ -2443,6 +2445,9 @@ void Content::insert(
else
{
xResAccess->PUT( xInputStream, Environment );
+ // remove options from cache, PUT may change it
+ // it will be refreshed when needed
+ aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
}
// no error , set the resourcetype to unknown type
// the resource may have transitioned from NOT FOUND or UNKNOWN to something else
@@ -2453,6 +2458,7 @@ void Content::insert(
}
catch ( DAVException const & except )
{
+ aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
if ( bCollection )
{
if ( except.getStatus() == SC_METHOD_NOT_ALLOWED )
@@ -2541,12 +2547,18 @@ void Content::insert(
// Unreachable
}
+ // save the URL since it may change due to redirection
+ 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 );
}
catch ( DAVException const & e )
{
+ aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
cancelCommandExecution( e, Environment, true );
// Unreachable
}