ucb/source/ucp/webdav-curl/webdavcontent.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 944853b03bc5a03ee424354669addb4fa9925fbe
Author:     Giuseppe Castagno <giuseppe.casta...@acca-esse.eu>
AuthorDate: Wed Jan 13 14:55:57 2016 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 1 18:41:01 2021 +0100

    ucb: webdav-curl: Related: tdf#96410 eXo Platform WebDAV: where lock 
fails...
    
    ...because apparently eXo Platform WebDAV does not support or supports
    poorly this section <http://tools.ietf.org/html/rfc4918#section-7.3>
    of RFC4918.
    It returns HTTP error 404 instead.
    
    [ port of commit 4475c191de479e7a5ddb20d14bc3aa32b0ab84d3 ]
    
    Change-Id: I58c91330806abbde5968ed22e98b9ff80c98c505
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123472
    Tested-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx 
b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index 483d409cb93b..de9cd6248a66 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -3199,6 +3199,10 @@ void Content::lock(
                 //grab the error code
                 switch( e.getStatus() )
                 {
+                    // The 'case SC_NOT_FOUND' just below tries to solve a 
problem in eXo Platform
+                    // WebDAV connector which apparently fail on resource 
first creation
+                    // rfc4918 section-7.3 (see link below)
+                    case SC_NOT_FOUND:              // 
<http://tools.ietf.org/html/rfc7231#section-6.5.4>
                     // The 'case SC_PRECONDITION_FAILED' just below tries to 
solve a problem
                     // in SharePoint when locking the resource on first 
creation fails due to this:
                     // 
<https://msdn.microsoft.com/en-us/library/jj575265%28v=office.12%29.aspx#id15>
@@ -3208,7 +3212,7 @@ void Content::lock(
                         // part of base http 1.1 RFCs
                     case SC_NOT_IMPLEMENTED:        // 
<http://tools.ietf.org/html/rfc7231#section-6.6.2>
                     case SC_METHOD_NOT_ALLOWED:     // 
<http://tools.ietf.org/html/rfc7231#section-6.5.5>
-                        SAL_WARN( "ucb.ucp.webdav", "lock() DAVException 
(SC_PRECONDITION_FAILED, SC_NOT_IMPLEMENTED or SC_METHOD_NOT_ALLOWED) - URL: <"
+                        SAL_WARN( "ucb.ucp.webdav", "lock() DAVException 
(SC_NOT_FOUND, SC_PRECONDITION_FAILED, SC_NOT_IMPLEMENTED or 
SC_METHOD_NOT_ALLOWED) - URL: <"
                                   << m_xIdentifier->getContentIdentifier() << 
">, DAV error: " << e.getError() << ", HTTP error: " << e.getStatus() );
                         // act as nothing happened
                         // that's because when a resource is first created

Reply via email to