Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Libcurl] Cleaning and comments #2534

Merged
merged 1 commit into from
Jun 13, 2023
Merged

Conversation

Hind-M
Copy link
Member

@Hind-M Hind-M commented May 17, 2023

No description provided.

if (res)
{
return static_cast<I>(res.value());
return static_cast<std::size_t>(res.value());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I maybe should've asked earlier but isn't casting to size_t a mistake since before it was a signed integer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's used to set speed and m_downloaded_size which are eventually converted to std::size_t in set_speed, update_progress and set_total of the ProgressBar...
These notions with m_retry_wait_seconds are also intuitively representing something that should be unsigned... I wonder why it's not handled in libcurl that way btw...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe they use negative values for errors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case, we should check the return value and return the appropriate tl::unexpected.

@Hind-M Hind-M self-assigned this May 22, 2023
@JohanMabille JohanMabille merged commit 75b2894 into mamba-org:main Jun 13, 2023
@Hind-M Hind-M deleted the curl_clean branch June 14, 2023 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants