Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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.

@COM8 COM8 force-pushed the fix/disable_session_move branch from fa9d8d4 to 2b56200 Compare December 28, 2023 10:34
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 force-pushed the fix/disable_session_move branch from 2b56200 to 47e7fa3 Compare December 28, 2023 14:58
@COM8 COM8 merged commit 6521668 into master Jan 5, 2024
@COM8 COM8 deleted the fix/disable_session_move branch January 5, 2024 12:26
ghost pushed 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
ghost pushed a commit to AllayMC/AllayLauncher that referenced this pull request Feb 23, 2025
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