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 30ca48f4dc
"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 <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
This commit is contained in:
László Németh
2023-02-24 09:43:55 +00:00
parent 6068ae5df9
commit d6182cb670
+5
View File
@@ -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;