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

New commits:
commit d6182cb6704c06f33d284874b9fe96c85cce5bf5
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Thu Feb 23 15:50:49 2023 +0100
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Fri Feb 24 09:43:55 2023 +0000

    tdf#153642 ucb: fix broken save with cached DAVOptions
    
    Trying to save a document within the lifetime of the
    cached connection, e.g. re-save within a few seconds after
    the first and successful save failed with an error message
    in the case of Vibe 4.0.6 WebDAV server. Waiting 5-10 seconds
    after the last try was the only workaround to re-save the
    document.
    
    Details: aDAVOptionsException in Content::getPropertyValues()
    removed the isClass1 bit of the cached DAVOptions of the
    same TargetURL (note: of the folder of the WebDAV document).
    This disabled the DAV detection part of Content::getResourceType(),
    and later the correct HTTP redirect for the DAV connection.
    Fix this by keeping the cached bit in that case, too, when the
    added connection has a different lifetime, than the cached one.
    
    Follow-up to commit 30ca48f4dc0e65a3798e6b21574bc80f6d4953fa
    "tdf#152493 ucb WebDAV: fix upload using HTTP 1.0 fallback".
    
    Change-Id: I5d4578232581a4df654f76198fdddf096cba5267
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147570
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>

diff --git a/ucb/source/ucp/webdav-curl/DAVTypes.cxx 
b/ucb/source/ucp/webdav-curl/DAVTypes.cxx
index 972f70cbc17a..d5b255c175cd 100644
--- a/ucb/source/ucp/webdav-curl/DAVTypes.cxx
+++ b/ucb/source/ucp/webdav-curl/DAVTypes.cxx
@@ -164,6 +164,11 @@ void DAVOptionsCache::addDAVOptions( DAVOptions & 
rDAVOptions, const sal_uInt32
     { // already in cache, check LifeTime
         if ( (*it).second.getRequestedTimeLife() == nLifeTime )
             return; // same lifetime, do nothing
+
+        // tdf#153642 keep cached Class1 bit at aDAVOptionsException to avoid 
of
+        // losing the ability to resave the document within the lifetime 
because
+        // of disabled DAV detection in getResourceType()
+        rDAVOptions.setClass1( (*it).second.isClass1() );
     }
     // not in cache, add it
     TimeValue t1;

Reply via email to