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

Wapped curl multi handle #2459

Merged
merged 1 commit into from
Apr 13, 2023
Merged

Conversation

JohanMabille
Copy link
Member

No description provided.

* CURLReference *
*****************/

CURLReference::CURLReference(CURL* handle)
Copy link
Member

Choose a reason for hiding this comment

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

Note that in other wrappers we have been using .raw()

Copy link
Member

Choose a reason for hiding this comment

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

Oups, this should be pointing at the unwrap line, sorry


CURLMultiHandle& CURLMultiHandle::operator=(CURLMultiHandle&& rhs)
{
std::swap(p_handle, rhs.p_handle);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldnt we set rhs in a non-owning state? Just swapping here will make it own what we have, it might not be immediately destroyed.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's ok to have rhs freeing the curl handle in its destructor later.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah but is it ok if it's not called immediately and rhs is still a valid usable object and is used before being destroyed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the object it is swapped with is in a valid state as soon as it has been constructed.

libmamba/src/core/curl.cpp Show resolved Hide resolved
libmamba/src/core/curl.cpp Outdated Show resolved Hide resolved
@JohanMabille JohanMabille force-pushed the multi_handle branch 2 times, most recently from d50d03b to 6b243e1 Compare April 13, 2023 14:01
Copy link
Member

@Klaim Klaim left a comment

Choose a reason for hiding this comment

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

LGTM!

@JohanMabille JohanMabille merged commit 38fe38e into mamba-org:main Apr 13, 2023
20 checks passed
@JohanMabille JohanMabille deleted the multi_handle branch April 13, 2023 16:39
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.

None yet

2 participants