ucb/source/ucp/webdav-curl/CurlSession.cxx | 7 +++++++ 1 file changed, 7 insertions(+)
New commits: commit 21c1f50373d1937fecd8e4e8c4dfba0f3066652e Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Oct 19 14:30:55 2022 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Fri Mar 8 16:25:08 2024 +0100 ucb: webdav-curl: try to share DNS and TLS data as well Not necessary but probably faster. Documentation says that CURL_LOCK_DATA_CONNECT isn't safe in a multi threaded program. Change-Id: Iae79c01330b48f443b94abf6101a50559cb46189 (cherry picked from commit fa5feda2f891651933703e029dcc757e47a6801f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164553 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx index 61c54cba2df8..858af08b5efb 100644 --- a/ucb/source/ucp/webdav-curl/CurlSession.cxx +++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx @@ -94,6 +94,13 @@ struct Init assert(!"curl_share_setopt failed"); ::std::abort(); // can't handle error here } + sh = curl_share_setopt(pShare.get(), CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS); + // might fail but this is just a perf improvement + SAL_WARN_IF(sh != CURLSHE_OK, "ucb.ucp.webdav.curl", "curl_share_setopt failed"); + sh = curl_share_setopt(pShare.get(), CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION); + // might fail but this is just a perf improvement + SAL_WARN_IF(sh != CURLSHE_OK, "ucb.ucp.webdav.curl", "curl_share_setopt failed"); + // note: CURL_LOCK_DATA_CONNECT isn't safe in a multi threaded program. } // do not call curl_global_cleanup() - this is not the only client of curl };