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

cpr::Session Is Now Unmovable/Copyable #999

Merged
merged 1 commit into from
Jan 5, 2024
Merged

Conversation

COM8
Copy link
Member

@COM8 COM8 commented Dec 26, 2023

Why?

cpr::Session is a complex object and while making it movable/copyable one has to keep all properties in mind. An easier solution would be to wrap cpr::Session inside for example a std::shared_ptr to allow it to be movable.

Copyable does not make sense since a curl session is not copyable in a useful way.
What should happen if you copy a cpr::Session in mids of a request? Should there be a new request with the same destination and the same connection state? This is not possible in a sensible way.

Fixes #990.

@COM8
Copy link
Member Author

COM8 commented Dec 26, 2023

Will be keep open for the next week or so, to ensure there are no other important arguments against this approach.

Why? cpr::Session is a complex object and while moving one has to keep all properties in mind.
An easier solution would be to wrap cpr::Session inside for example a std::shared_ptr.
@COM8 COM8 merged commit 6521668 into master Jan 5, 2024
86 of 105 checks passed
@COM8 COM8 deleted the fix/disable_session_move branch January 5, 2024 12:26
epicbigcat added a commit to AllayMC/AllayLauncher that referenced this pull request Nov 18, 2024
note: after 1.11.0, `cpr::Session` is no longer movable & copyable: libcpr/cpr#999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect implementation of cpr::Session move constructor and move assignment operator
1 participant