summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-11-01ucb: webdav-curl: tdf#101094 (29) Fix for IIS 10.0 disabled OPTIONS methodGiuseppe Castagno
When OPTIONS methods (or verb) is disabled (or denied) on a IIS 10.0 web server, error 404 (e.g. 'Not Found') is emitted, so we need to deal with it. [ port of commit e0d0d87257d62ac61377a73909e17753f96e7aaa ] Change-Id: I67309f1bce20bba1399a9a3c22568291d095ac69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123484 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related: tdf#82677, remove cached element when appropriateGiuseppe Castagno
[ port of commit 90ded4cbf1ffbde2ef7926fb225759896ef075bf ] Change-Id: I7ffe75dc7a85088086f33b22eb1338ea22c1f363 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123483 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related: tdf#82677, add cache use in Content::getProperties()Giuseppe Castagno
[ port of commit 00e1f840be4a1ff202d82377b3cbf233b352b1c3 ] Change-Id: I8c7f372404239276101fb7f64ba3415ef922e7e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123482 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related: tdf#82677, implement a PROPFIND 'propname' ↵Giuseppe Castagno
request cache PROPFIND 'propname' is the special usage to retrieve all the properties available on the URI resource, their names only. See <https://tools.ietf.org/html/rfc4918#section-9.1> for PROPFIND 'propname' definition. Add cache usage in Content::getProperties as well. The caching model is simple: a simple lifetime limit of 10 seconds to declare the property name list stale and request another list, accessing the Net. This should reduce the number of PROPFIND calls on the Net. [ port of commit 98bd24f8b479132ca3f2d884749b738e9e6203e3 ] Change-Id: I48ae38f706370557698dd80e31840b44e05bfef6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123481 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (26): Fix possible early relase of cache mutexGiuseppe Castagno
[ port of commit 6431e91eca9e44684066a32ed3d6411509dac781 ] Change-Id: I90391c38bf9d0f4acf68ce29b2382ad855aa56ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123480 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (25): Make a std::less explicit, add/remove ↵Giuseppe Castagno
TODOs... ... and a bit of function member signature change. [ port of commit 5300b55a1dbcbea6ea244e66e3bc91a0218db5c9 ] Change-Id: Ia9d8f78c2fb39bd0943d4c2fb7d9b11cbee1034a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123479 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (24): Simplify cache removal: DESTROY, ↵Giuseppe Castagno
PROPPATCH, MOVE Plus another PUT forgotten on a previuos commit. [ port of commit 1ed01e1bcc929d363ad5f3c4d2cf262a20134412 plus move Uris back into try block ] Change-Id: Ieda94cc855f8a6b648dda404dfad411795c3dc33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123478 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (23): Simplify cache removal: MOVE, COPYGiuseppe Castagno
[ port of commit 63af1c52c534840d1f55e3041351d24b85edcaa4 plus move Uris back into try block ] Change-Id: I8cc7f6e14fcac294531b5be8fdbaf78610a3adfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123477 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related: tdf#99499, add a limit to the number of http ↵Giuseppe Castagno
redirections Check for maximum number of redirections according to <https://tools.ietf.org/html/rfc7231#section-6.4>. A practical limit can be 5, due to old RFC: <https://tools.ietf.org/html/rfc2068#section-10.3>, this limit is reported also in more recent RFCs, see final paragraph of RFC7231, 6.4. [ port of commit 18009fe8fbe3982141ddca3f1fcd0900a63150a6 ] Change-Id: I3a6d1510627434cdff9e4f0af8194a8e6a33c28b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123476 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (22): Simplify cache removal: MKCOL, PUTGiuseppe Castagno
[ port of commit 8ff5e67dea29d9ceb100a67a69f6deb4c6f18e13 ] Change-Id: If24272566bfb5fba32b9df9bd0f8e1c7fe18c585 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123475 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (21): Simplify cache removal: LOCK, UNLOCKGiuseppe Castagno
[ port of commit 508f78298833f45fd9e2e789aa26cca125719baf ] Change-Id: I81185c11ed3ad216b13fcbafee45ea3a48cf0a12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123474 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (20) OPTIONS: Check for Class1 DAV before unlockGiuseppe Castagno
[ port of commit d14977d33bc3edb6a2c41db4d685d099bfe8d51e ] Change-Id: I559d71f49e582af50ef88ea42beba48d38180134 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123473 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related: tdf#96410 eXo Platform WebDAV: where lock fails...Giuseppe Castagno
...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.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01tdf#145496 Add dropped nLineWidth from refactoringJan-Marek Glogowski
Regression from commit 4fc1b3fb659be916167518b49ffe8193e9033f30 ("flatten ImplGetTextLines"). Change-Id: Ib9f086243b4e3ae245263492e714de6f81b89ea1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124557 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Tested-by: Jenkins
2021-11-01ucb: webdav-curl: tdf#101094 (19) OPTIONS: Add mechanism to manage not found ↵Giuseppe Castagno
Web URL: GET [ port of commit 7f32fddb445ef1c1e17f9028f252c21dd83e03af ] Change-Id: Ie1412f849df0b9da76ccc41309e8e587c8f36c7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123471 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (18) OPTIONS: Update OPTIONS cache lifetime if ↵Giuseppe Castagno
not found [ ported from commit a5fc27e0575eab115de3714ae07fcac7481f4daf ] Change-Id: I61d06051a4526676fc4ab80d653ab7c2a9e4c209 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123470 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (17) OPTIONS: Options cache removal: COPYGiuseppe Castagno
[ port of commit bedae6b06c51c641c38fa7dd3e25dd2aaafb30cf ] Change-Id: I1618a7a5ec4e52fdd9e99b17b2b36e5ef77decae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123469 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (16) OPTIONS: Options cache removal: MOVEGiuseppe Castagno
[ port of commit 2359e5a002f4df58548803320991064e6a6d968c ] Change-Id: I27a68855198fe220a1f4141bb89673992c12e1f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123468 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (15) OPTIONS: Options cache removal: MKCOLGiuseppe Castagno
[ port of commit 1596379bc00a32bc3b4e76a53aa884112b21764b ] Change-Id: If217fde550ef55375e4743de00dcb325a89674c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123467 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (14) OPTIONS: Options cache removal: PUTGiuseppe Castagno
[ 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>
2021-11-01ucb: webdav-curl: CurlSession OPTIONS() lock cacheMichael Stahl
Change-Id: I3a815e70db04439dc33d57ce9e214d52a7f0e08d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123465 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (13) OPTIONS: Options cache removal: LOCK, UNLOCKGiuseppe Castagno
[ port of commit dfb714183f31d8a235797ef1ad3c517966ed4985 ] Change-Id: I1cf4689847f4f033d6f8cc40265b98b9614363e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123464 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (12) OPTIONS: Add options cache ctrl in ↵Giuseppe Castagno
getResourceOptions [ port of commit 37ada6f457e19b6ee2d2adb0b0ab3acb20705b51 ] Change-Id: I3cfd71c0c90b828de7d953d5ff3f0e445b3f156f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123463 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (11): Add WebDAV options cache configuration param.Giuseppe Castagno
Added in officecfg five new properties to be able to set cache lifetime if needed. The new properties are available in advanced, expert configuration only, in org.openoffice.Inet.Settings. Default values are as follows (value is in seconds): OptsCacheLifeImplWeb = 300 when the web resource is Web only, implementing OPTIONS. Min. 0 sec (no caching) max. 3600 sec (1h). OptsCacheLifeDAV = 60 when the web resource is WebDAV. Min. 0 sec (no caching) max. 3600 sec (1h). OptsCacheLifeDAVLocked = 600 when the web resource is WebDAV and it's locked by this LO instance (e.g. lock store has a lock to it). Min. 0 sec (no caching) max. 3600 sec (1h). OptsCacheLifeNotImpl = 3600 when the web resource does not implement OPTIONS method. Min. 0 sec (no caching) max. 43200 sec (12h). OptsCacheLifeNotFound = 15 when the requested web resource is not found on server. Min. 0 sec (no caching) max. 30 sec. [ port of commit 2c0b4ff238f39b5fcce09c7d36e80ac1e7cb713e ] Change-Id: I5a4c44449c91b7d3a8840bfaf8326e35f86415dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123462 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (10) OPTIONS: Add a simple options cache classGiuseppe Castagno
Added behavioral unit tests as well. [ port of commit b641d83bb9f8adba1a487ca0e04d7151f96c3eea ] Change-Id: Ie8867aeb45dcc8d343b156608e8a30970f76f6f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123292 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (9) OPTIONS: Add options check in ↵Giuseppe Castagno
Content::getProperties [ port of commit be47f60b51c053c6329637e829ce16e2e90610fe ] Change-Id: I8fd0dbc1f9847e799c244821bfe4e628c39c2017 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123291 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (8) OPTIONS: Add options check in ↵Michael Stahl
Content::resourceTypeForLocks [ port of commit 6ab2cabeae02b6beb3c33238773ba075f41c4bb9 ] Change-Id: I10f928fb5484738553769f54353ca7637e0780ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123290 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (7) OPTIONS: Remove resourceTypeForLocks before ↵Giuseppe Castagno
unlock Not needed, unlock() checks if a lock is present first. If present, it means that LOCK is available, inferring the presence of UNLOCK availability. [ port of commit fd586445a47d50ebfff67a7d5e4a329cf064cb92 ] Change-Id: I639c558c6e6f322f37d267bbc31309504745e02c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123289 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (6) OPTIONS: Do not retry on HTTP error 501Giuseppe Castagno
HTTP error 501 the server tells us the used method is not implemented, non need to retry. [ port of commit 6dcd231892d80d2f130d1b9ebb9cf7dfa1115df1 ] Change-Id: I5325f6527c7bb5c8f87d4301fd13eb6c71a318f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123288 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (5) OPTIONS: Add options check in ↵Giuseppe Castagno
Content::getResourceType Added some verbose SAL_INFO to detail server responses to PROPFIND. Corrected a wrong comment and beautified a bit code I introduced in commit 3b26a2a403ca5e99b0dd07d042d47501c091af16. [ port of commit 211cb2dec3501a9ea224512ebedbc7cd1c46cd45 ] Change-Id: I7917408dcc09e42cb23d29b28e02904594023dd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123287 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: indent that temporarilyMichael Stahl
Change-Id: I8cd3373b64c29d1f76c19a8f229cda0060cc79cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123286 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (4) OPTIONS: Add member function getResourceOptionsGiuseppe Castagno
[ port of commit 2777b6380c17bad8a966454947b9d991f9592224 ] Change-Id: I8c54b564a8c92dcd395e104976f7a7071b5264eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123285 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: implement DAVResourceAccess::OPTIONS()Michael Stahl
This is just a copy of DAVResourceAccess::PROPFIND() and trivially adapting 4 lines to call DAVSession::OPTIONS() with required arguments. Change-Id: If2ac8e4a465d0f09b7cf02647ac4c8e4860c45b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123284 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: implement OPTIONS()Michael Stahl
Change-Id: I601a161c3e6c4b7e741a79bfd15510bb40b5d81c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123283 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (1) OPTIONS: New class to store retrieved OPTIONSGiuseppe Castagno
This class describes the DAV options useful to LO. Added behavioural unit tests as well. [ port of commit f950b49393ee6539f2a7b3c306aa4fc119f24a84 ] Change-Id: Idfcd66229a2bbbdf4452da731a5b921527447358 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123282 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: loplugin:unusedfields in ucb/Michael Stahl
[ replicate commit 00bb8141beee7088625992a046e94c6f8da8da83 ] Change-Id: I8144eca6b27fda799a8e875b568a3bcf6b974d96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123281 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: In case of Web site access, add Content-Type to HEAD request.Giuseppe Castagno
This remove a necessity for another HEAD request when MediaType is requested while accessing a Web site, a cleaner implementation of d61352f58a7f750d3b0b0a9c2d6498fbb7a6e10d. This behavior is active only on a standard Web site, when PROPFIND failed earlier on the program flow, without retrieving the property DAV:getcontenttype. [ port of commit 9325c18044a8adc852e2d1b42a5a479ab6195da8 ] Change-Id: Iebdae815d096be8ef45b969d7c4d84acc26694b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123280 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: loplugin:unuseddefaultparam in ucbNoel Grandin
[ port of commit 83911dd753fbfd0328bae2dfa37d19f514d4b2f9 ] Change-Id: I5a57b7af9cd231e89fc93cc1a5f277cae23a1427 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123279 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related tdf#95217: Force HEAD method in Web access if ↵Giuseppe Castagno
PROPFIND failed [ port of commit d61352f58a7f750d3b0b0a9c2d6498fbb7a6e10d ] Change-Id: Id945be7a1f71c830f3ab15c54fbf65a32be71a2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123278 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related tdf#95217: Http header names are case insensitiveGiuseppe Castagno
[ port of commit e973b342826e54f147251b132c3325d30749e312 ] Change-Id: I7473625894c023c526a8ffeccd7ec6d67629ff76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123277 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related tdf#90700 Add configuration for web connection ↵Giuseppe Castagno
timeout. Currently the connection timeout is governed by operating system default. LO timeouts will be used in place of the TCP socket operating system ones, only in operating system where this is currently possible. The timeouts to use can be changed in LO configuration: 'Tools > Options > Advanced > Expert Configuration'. Propriety names are ConnectTimeout and ReadTimeout. ConnectTimeout contains the timeout (in seconds) used when making a connection (max 180 s, min 2 s, default 20 s). ReadTimeout contains the timeout (in seconds) used when reading from a socket (max 180 s, min 20 s, default 60 s). [ port of commit 14220052ef2b8675ee12aad63b0402f023d9760a omitting Session change which isn't directly possible ] Change-Id: I276851958f587346a36ee5f173b3e4fb88a944b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123276 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#95792: fix saving file the first time on some WebDAV ↵Giuseppe Castagno
servers. Some WebDAV servers don't implement section 7.3 of RFC4918: <http://tools.ietf.org/html/rfc4918#section-7.3> This lack of implementation breaks 'Save As...' functionality when the target is a WebDAV server, by not locking the URL ('reserve the name for use', in RFC4918 parlance). The server not implementing this usually answers with one of '405 Method Not Allowed', '501 Not Implemented' or '412 Precondition Failed' http error codes. The fix should manage this lack of implementation. [ port of commit 4c82edfb3a9286a0bfef3f006e468e5c331987eb ] Change-Id: I343368bb91bdffff143aa26d8449b48f3b5300d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123275 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Fix tdf#90700 Notify connect timeout early.Giuseppe Castagno
Throws exception to manage timeout early in the first connection sequence. [ port of commit 95958755cbbf8c6026b878703400d5d9ec1e6c98 ] Change-Id: Ib6d306100ab04a3a21c37108d5c88185acf2524a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123274 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Add/change some logs in WebDAV ucb.ucp layer.Michael Stahl
[ replicate commit dd9c15b36f69bec4d4fc9b0049f7e496e5eb9e9d ] Change-Id: I9eb87ea7216c83ce1ac63f65dd96ebe6760a50a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123273 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#83531 Opening WebDAV URL WebDav fails if write is ↵Giuseppe Castagno
restricted Happened because LOCK method was not allowed without credentials. [ port of commit 0326352470aee1a774bb5aa314c4f3625c1372b3 ] Change-Id: Id94b96856737e50715c2a18427ba22c3776a8da9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123272 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#82744: fix WebDAV lock/unlock behaviour - part 3Giuseppe Castagno
Changes done to the code in sfx2, ucbhelper, ucb, unotools in no particular order - add method helpers to call the ucb lock/unlock - add lock/unlock 'real' management - make DateChange property retrieval working for WebDAV as well - add check for changed content of a WebDAV file, in order to reload it correctly when 'Edit Mode' command is activated from GUI - Unlock WebDAV file while saving only if explicitly enabled Needed in order to avoid the small window of file unlocked state that opens while saving a file. When saving LO actually does as follows: - unlock the prevoius version of the file - prepares operations to save the modified version - lock the new file - save the new version - the lock method is enabled if the DAV resource supports it. In case the lock is not supported, for example example DAV with lock disabled, the lock method is disabled. Exception: when the resource is first created and the lock is not supported: a lock command is sent anyway, because if the resource is not yet present, there is no method to detect the lock/unlock availability in this case. - cppcheck:noExplicitConstructor [ port of commit b4576f3da4d90139fc5140962d13cb91dab98797 excluding the obsolete FTP scheme thing ] Change-Id: I16bb4e2fa9899fd31af7c223390f3fb213330fa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123228 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Remove redundant comparisons, copy properties unconditionallyMichael Stahl
[ replicate commit 39bbfa61653ba7c3cca0aed739559914c78edc89 ] Change-Id: I28730c1fc7f6808bf9657855cf1d65369b695c4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123227 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#82744: fix WebDAV lock/unlock behaviour - part 1Giuseppe Castagno
There are some areas in ucb outside the issue scope that should later be addressed, among them: - in ucb/webdav make flag m_bTransient working right, currently lock option for WebDAV server not supporting it is suboptimal: there are not needed lock requests; - change the method the modified file is checked against the old one, using DAV:etag instead of the DateTime; - some http status code returned by the server don't seem to be managed; - during WebDAV operation some redundant request of properties is carried out. Probably some clean up to remove these not needed transactions is to be done. Accessing only those really supported by the referenced href would be better. Changes done to the code in ucb, in no particular order - remove current WebDAV lock management - have the lock/unlock working correctly when the webdav resource is first created: in the case of creation is the first lock on the non existent resource that actually creates it - fix a problem while fetching WebDAV properties. If a single WebDAV non-cached property was requested, it would not be fetched from the server without this fix. - change the lock owner name. This should probably be different. Something to be discussed. This same string can be read by all the applications accessing the lock. Spec reference is: RFC4918 [2007]: '14.17. owner XML Element' link (as of 20150713): http://tools.ietf.org/html/rfc4918#section-14.17 - manage WebDAV locked file exception directly while locking. The ucb::InteractiveLockingLockedException is thrown directly when detected by the lock command, to avoid the user interaction activated by the cancelCommandExecution method. - terminate gracefully if WebDAV lock/unlock is not supported [ port of commit 26e6d4b05ab444e6a7529ffcac7fbe592fc94833 ] Change-Id: I0a4c926dc1e32cc620ad6e9acfc9c9c56928fa49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123226 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: remove unused LOCK() overloadMichael Stahl
Removed from neon in commit 9d7727737b067c5228f129737046f718d5965659 Change-Id: I1df14d8e05e50a6a0ce7af4f6079f11be6628903 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123225 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: NeonLockStore::stopTicker(): really avoid deadlockMichael Stahl
Follow up on 68ba2785c55eaa1ea70ce135bdad5322b0e04ed7, which missed the sad fact that m_aMutex is locked recursively. Avoid that by passing a ClearableMutexGuard to stopTicker() and unlocking that. Also lock m_aMutex in the destructor while at it. [ port of commit 13b60fd80a7adfb0ef81a818917cfec5edfc6edc ] Change-Id: I65bb4ec98f13d28089c3b2eb3300074944024188 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123181 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>