summaryrefslogtreecommitdiffstats
path: root/ucb/source/ucp/webdav-curl/CurlSession.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'ucb/source/ucp/webdav-curl/CurlSession.cxx')
-rw-r--r--ucb/source/ucp/webdav-curl/CurlSession.cxx37
1 files changed, 15 insertions, 22 deletions
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index a54e9d1add..2f104d5388 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -166,15 +166,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
@@ -1519,9 +1510,8 @@ auto CurlSession::OPTIONS(OUString const& rURIReference,
DAVResource result;
::std::pair<::std::vector<OUString> const&, DAVResource&> const headers(headerNames, result);
- ::std::vector<CurlOption> const options{
- g_NoBody, { CURLOPT_CUSTOMREQUEST, "OPTIONS", "CURLOPT_CUSTOMREQUEST" }
- };
+ ::std::vector<CurlOption> const options{ { CURLOPT_CUSTOMREQUEST, "OPTIONS",
+ "CURLOPT_CUSTOMREQUEST" } };
CurlProcessor::ProcessRequest(*this, uri, "OPTIONS", options, &rEnv, nullptr, nullptr, nullptr,
&headers);
@@ -1829,7 +1819,13 @@ auto CurlSession::HEAD(OUString const& rURIReference, ::std::vector<OUString> co
CurlUri const uri(CurlProcessor::URIReferenceToURI(*this, rURIReference));
- ::std::vector<CurlOption> const options{ g_NoBody };
+ ::std::vector<CurlOption> const options{
+ // 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,
io_rResource);
@@ -2064,9 +2060,8 @@ auto CurlSession::MKCOL(OUString const& rURIReference, DAVRequestEnvironment con
CurlUri const uri(CurlProcessor::URIReferenceToURI(*this, rURIReference));
- ::std::vector<CurlOption> const options{
- g_NoBody, { CURLOPT_CUSTOMREQUEST, "MKCOL", "CURLOPT_CUSTOMREQUEST" }
- };
+ ::std::vector<CurlOption> const options{ { CURLOPT_CUSTOMREQUEST, "MKCOL",
+ "CURLOPT_CUSTOMREQUEST" } };
CurlProcessor::ProcessRequest(*this, uri, "MKCOL", options, &rEnv, nullptr, nullptr, nullptr,
nullptr);
@@ -2094,9 +2089,8 @@ auto CurlProcessor::MoveOrCopy(CurlSession& rSession, std::u16string_view rSourc
throw uno::RuntimeException("curl_slist_append failed");
}
- ::std::vector<CurlOption> const options{
- g_NoBody, { CURLOPT_CUSTOMREQUEST, pMethod, "CURLOPT_CUSTOMREQUEST" }
- };
+ ::std::vector<CurlOption> const options{ { CURLOPT_CUSTOMREQUEST, pMethod,
+ "CURLOPT_CUSTOMREQUEST" } };
CurlProcessor::ProcessRequest(rSession, uriSource, OUString::createFromAscii(pMethod), options,
&rEnv, ::std::move(pList), nullptr, nullptr, nullptr);
@@ -2126,9 +2120,8 @@ auto CurlSession::DESTROY(OUString const& rURIReference, DAVRequestEnvironment c
CurlUri const uri(CurlProcessor::URIReferenceToURI(*this, rURIReference));
- ::std::vector<CurlOption> const options{
- g_NoBody, { CURLOPT_CUSTOMREQUEST, "DELETE", "CURLOPT_CUSTOMREQUEST" }
- };
+ ::std::vector<CurlOption> const options{ { CURLOPT_CUSTOMREQUEST, "DELETE",
+ "CURLOPT_CUSTOMREQUEST" } };
CurlProcessor::ProcessRequest(*this, uri, "DESTROY", options, &rEnv, nullptr, nullptr, nullptr,
nullptr);