Skip to content

Commit

Permalink
Fix CURLHandle::get_info on 32bit platform (#2528)
Browse files Browse the repository at this point in the history
fix get_info bug on 32 bit devices
  • Loading branch information
e8035669 authored May 16, 2023
1 parent 32c64cd commit 803f89e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libmamba/src/core/curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ namespace mamba
template tl::expected<long, CURLcode> CURLHandle::get_info(CURLINFO option);
template tl::expected<char*, CURLcode> CURLHandle::get_info(CURLINFO option);
template tl::expected<double, CURLcode> CURLHandle::get_info(CURLINFO option);
template tl::expected<long long, CURLcode> CURLHandle::get_info(CURLINFO option);
template tl::expected<curl_slist*, CURLcode> CURLHandle::get_info(CURLINFO option);

template <class I>
Expand All @@ -305,7 +306,15 @@ namespace mamba
template <>
tl::expected<std::size_t, CURLcode> CURLHandle::get_info(CURLINFO option)
{
return get_integer_info<std::size_t>(option);
auto res = get_info<curl_off_t>(option);
if (res)
{
return static_cast<std::size_t>(res.value());
}
else
{
return tl::unexpected(res.error());
}
}

template <>
Expand Down

0 comments on commit 803f89e

Please sign in to comment.