diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-01-31 13:47:50 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-01-31 16:55:21 +0100 |
commit | 9b5894e67d6ba820443c9f1130231be8c0278f82 (patch) | |
tree | a06c869c8ee1bc2afe87f6f6923fed79d21bb273 /ucb | |
parent | 81abc0d7657f194804681415a786627ab71475e3 (diff) |
ucb: webdav-curl: suppress libcurl proxy detection
The UCP already reads proxy configuration from configmgr, including a
list of hosts that should ignore proxy: Inet::Settings::ooInetNoProxy
Hence also set an empty string with CURLOPT_PROXY, disabling the
detect_proxy() function.
(The neon library was never built with the libproxy dependency it
needs to detect proxies.)
Change-Id: I279d1b85dbdd2455791d393e634a1fa7c1c17ce0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129220
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/webdav-curl/CurlSession.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx index 542aba73edcf..90ce91c3cddc 100644 --- a/ucb/source/ucp/webdav-curl/CurlSession.cxx +++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx @@ -679,18 +679,19 @@ CurlSession::CurlSession(uno::Reference<uno::XComponentContext> const& xContext, assert(rc == CURLE_OK); rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_HTTPAUTH, CURLAUTH_ANY); assert(rc == CURLE_OK); // ANY is always available + // always set CURLOPT_PROXY to suppress proxy detection in libcurl + OString const utf8Proxy(OUStringToOString(m_Proxy.aName, RTL_TEXTENCODING_UTF8)); + rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_PROXY, utf8Proxy.getStr()); + if (rc != CURLE_OK) + { + SAL_WARN("ucb.ucp.webdav.curl", "CURLOPT_PROXY failed: " << GetErrorString(rc)); + throw DAVException(DAVException::DAV_SESSION_CREATE, + ConnectionEndPointString(m_Proxy.aName, m_Proxy.nPort)); + } if (!m_Proxy.aName.isEmpty()) { rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_PROXYPORT, static_cast<long>(m_Proxy.nPort)); assert(rc == CURLE_OK); - OString const utf8Proxy(OUStringToOString(m_Proxy.aName, RTL_TEXTENCODING_UTF8)); - rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_PROXY, utf8Proxy.getStr()); - if (rc != CURLE_OK) - { - SAL_WARN("ucb.ucp.webdav.curl", "CURLOPT_PROXY failed: " << GetErrorString(rc)); - throw DAVException(DAVException::DAV_SESSION_CREATE, - ConnectionEndPointString(m_Proxy.aName, m_Proxy.nPort)); - } // set this initially, may be overwritten during authentication rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_PROXYAUTH, CURLAUTH_ANY); assert(rc == CURLE_OK); // ANY is always available |