diff options
Diffstat (limited to 'ucb/source/ucp/webdav-curl/CurlSession.cxx')
-rw-r--r-- | ucb/source/ucp/webdav-curl/CurlSession.cxx | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx index e1cfd2c3f79f..9fe20d10794f 100644 --- a/ucb/source/ucp/webdav-curl/CurlSession.cxx +++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx @@ -118,15 +118,21 @@ struct CurlOption enum class Type { Pointer, - Long + Long, + CurlOffT }; Type const Tag; union { void const* const pValue; long const lValue; + curl_off_t const cValue; }; #if 0 ::std::variant<void const*, long +#if SAL_TYPES_SIZEOFLONG == 4 + , + curl_off_t +#endif > const Value; #endif char const* const pExceptionString; @@ -147,11 +153,14 @@ struct CurlOption { } #if SAL_TYPES_SIZEOFLONG == 4 - // According to mst this might get used "if one of the options to set stream size like - // CURLOPT_INFILESIZE_LARGE were used but it's not the case currently", so keep this ctor - // around as deleted in case it would ever become necessary to extend Value with a curl_off_t - // case: - CurlOption(CURLoption, curl_off_t, char const*) = delete; + CurlOption(CURLoption const i_Option, curl_off_t const i_Value, + char const* const i_pExceptionString) + : Option(i_Option) + , Tag(Type::CurlOffT) + , cValue(i_Value) + , pExceptionString(i_pExceptionString) + { + } #endif }; @@ -200,6 +209,12 @@ public: { rc = curl_easy_setopt(m_pCurl, it.Option, *pLong); } +#if SAL_TYPES_SIZEOFLONG == 4 + else if (curl_off_t const* const pOfft = ::std::get_if<curl_off_t>(&it.Value)) + { + rc = curl_easy_setopt(m_pCurl, it.Option, *pOfft); + } +#endif #endif if (it.Tag == CurlOption::Type::Pointer) { @@ -209,6 +224,12 @@ public: { rc = curl_easy_setopt(m_pCurl, it.Option, it.lValue); } +#if SAL_TYPES_SIZEOFLONG == 4 + else if (it.Tag == CurlOption::Type::CurlOffT) + { + rc = curl_easy_setopt(m_pCurl, it.Option, it.cValue); + } +#endif else { assert(false); @@ -246,6 +267,12 @@ public: { rc = curl_easy_setopt(m_pCurl, it.Option, 0L); } +#if SAL_TYPES_SIZEOFLONG == 4 + else if (curl_off_t const* const pOfft = ::std::get_if<curl_off_t>(&it.Value)) + { + rc = curl_easy_setopt(m_pCurl, it.Option, curl_off_t(0)); + } +#endif #endif if (it.Tag == CurlOption::Type::Pointer) { @@ -255,6 +282,12 @@ public: { rc = curl_easy_setopt(m_pCurl, it.Option, 0L); } +#if SAL_TYPES_SIZEOFLONG == 4 + else if (it.Tag == CurlOption::Type::CurlOffT) + { + rc = curl_easy_setopt(m_pCurl, it.Option, curl_off_t(0)); + } +#endif else { assert(false); |