diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-10-19 14:30:55 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2024-03-08 16:25:08 +0100 |
commit | 21c1f50373d1937fecd8e4e8c4dfba0f3066652e (patch) | |
tree | ac6c8e901b2cedb4b22a8dd7d06ff9d6eea28b18 /ucb | |
parent | 27fb4efea57881d49e9598e84b4a1df6a6e8719a (diff) |
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.stahl@allotropia.de>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/webdav-curl/CurlSession.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
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 }; |