summaryrefslogtreecommitdiff
path: root/ucb/source
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-05-02 16:44:31 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2022-05-03 14:42:05 +0200
commit5801b887629dbd784116ec6878b61bb99e991647 (patch)
tree66d93ebbdcc8383be8b97df7249af783a0b7d535 /ucb/source
parent0a415b92d3c1ea2c5befd30b4ac29442f422a41d (diff)
tdf#148426 ucb: webdav-curl: fall-back to GET if OPTIONS status 500
With the ndr.de server, OPTIONS on an image URL results in a status 500 Internal Server Error and an unexpected closed connection: 16.591:info:ucb.ucp.webdav.curl:1634132:1634170:ucb/source/ucp/webdav-curl/CurlSession.cxx:285: debug log: 0x7f9c94004988: transfer closed with 222 bytes remaining to read Apparently Neon always reported the closed connection problem with a string: "Could not read response body: connection was closed by server" The HTTP status code is extracted in makeStatusCode() and the string doesn't contain it, so the status is reported as 0 up the stack. With curl, it can apparently happen that either CURLE_PARTIAL_FILE is returned, in which case the status is ignored and reported as 0, or CURLE_OK is returned and the status 500 is reported up the stack. Adapt the handling in Content::open() to fall back to GET in case of a 500 status. Change-Id: I5f3dce7f67ce25c87bf3882c89e7ff2d386bcbad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133707 Tested-by: Jenkins Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb/source')
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontent.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index 995da2c7ba26..30fc16f2de56 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -2254,7 +2254,9 @@ uno::Any Content::open(
DAVOptions aDAVOptions;
getResourceOptions( xEnv, aDAVOptions, xResAccess );
- if ( aDAVOptions.getHttpResponseStatusCode() != SC_NONE )
+ if (aDAVOptions.getHttpResponseStatusCode() != SC_NONE
+ // tdf#148426 fall back to GET in case of 500
+ && aDAVOptions.getHttpResponseStatusCode() != SC_INTERNAL_SERVER_ERROR)
{
// throws exception as if there was a server error, a DAV exception
throw DAVException( DAVException::DAV_HTTP_ERROR,