summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-01-11 11:11:19 +0100
committerGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-07-29 16:39:04 +0000
commite0eb85785b68867f1476553723dbfc6dc407106b (patch)
tree997eb3f0f0ccc4bbb342eff27efdc46a275c71a0
parentdfb714183f31d8a235797ef1ad3c517966ed4985 (diff)
tdf#101094 (14) OPTIONS: Options cache removal: PUT
Change-Id: I251bbb101b4be851deaab66cbe4e10ff1fa3376e Reviewed-on: https://gerrit.libreoffice.org/27691 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu>
-rw-r--r--ucb/source/ucp/webdav-neon/webdavcontent.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index 81c015c630db..67d21ab4aca2 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -2422,6 +2422,8 @@ void Content::insert(
aURL += aEscapedTitle;
+ // save the URL to clean cache
+ OUString aTargetUrl = aURL;
try
{
xResAccess->setURL( aURL );
@@ -2431,6 +2433,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
@@ -2441,6 +2446,7 @@ void Content::insert(
}
catch ( DAVException const & except )
{
+ aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
if ( bCollection )
{
if ( except.getStatus() == SC_METHOD_NOT_ALLOWED )
@@ -2528,12 +2534,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
}