summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2024-03-14 15:47:28 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2024-03-14 19:37:57 +0100
commit6d4b6d11b4b55e530315cb2e4bedc16be4dca3bc (patch)
treec89d0796d6ce3d845b0251f2e9d03d09d5ef1368
parent602175e05f29921649f467df3f5e81a5a399737b (diff)
ucb: webdav-curl: always set CURLOPT_NOBODY for HEADdistro/cib/libreoffice-6-4
Otherwise there will be timeout that depends on when the server will close the connection, which varies by server but can be several minutes; getting a potential error document from the server for this one request when logging is enabled is less important. Change-Id: I505b014b148ba009c400d37d826c9edb8c3a6da2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164838 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit c8400f5acc36d2cf0c007260bdc94534a53bba90)
-rw-r--r--ucb/source/ucp/webdav-curl/CurlSession.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 7fb981838e3e..0d384633d66a 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -209,15 +209,6 @@ struct CurlOption
}
};
-// NOBODY will prevent logging the response body in ProcessRequest() exception
-// handler, so only use it if logging is disabled
-const CurlOption g_NoBody{ CURLOPT_NOBODY,
- sal_detail_log_report(SAL_DETAIL_LOG_LEVEL_INFO, "ucb.ucp.webdav.curl")
- == SAL_DETAIL_LOG_ACTION_IGNORE
- ? 1L
- : 0L,
- nullptr };
-
/// combined guard class to ensure things are released in correct order,
/// particularly in ProcessRequest() error handling
class Guard
@@ -1947,7 +1938,11 @@ auto CurlSession::HEAD(OUString const& rURIReference, ::std::vector<OUString> co
CurlUri const uri(CurlProcessor::URIReferenceToURI(*this, rURIReference));
::std::vector<CurlOption> const options{
- g_NoBody, { CURLOPT_CUSTOMREQUEST, "HEAD", "CURLOPT_CUSTOMREQUEST" }
+ // NOBODY will prevent logging the response body in ProcessRequest()
+ // exception, but omitting it here results in a long timeout until the
+ // server closes the connection, which is worse
+ { CURLOPT_NOBODY, 1L, nullptr },
+ { CURLOPT_CUSTOMREQUEST, "HEAD", "CURLOPT_CUSTOMREQUEST" }
};
::std::pair<::std::vector<OUString> const&, DAVResource&> const headers(rHeaderNames,