summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-11-19 18:08:45 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-22 10:54:41 +0100
commit4d75e29b3bba8a4002231dbc507f79ea63dccd82 (patch)
tree6144b8f817349938aaab1cb5cd4e0c0496dc57a4
parent3c62f72d7eda7a2d377cf45490c8c67403d8d745 (diff)
Revert "The CurlOption curl_off_t case appears to be unused"
This reverts commit 20168b1f09b4d2aa8643dc7d4a16d8a1dd1008a6. Change-Id: I3ac7bdeece94ec2a0e01d67f2788874b3f286fe4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125578 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--ucb/source/ucp/webdav-curl/CurlSession.cxx45
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);