We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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::Multiperform
cpr::Multiperform assignment is broken once the object has been used before.
Workaround: Use a std::uniqe_ptr around cpr::Multiperform.
std::uniqe_ptr
Take this test case:
TEST(MultiperformGetTests, MultiperformAssignAfterUseTest) { MultiPerform multiperform; { Url url{server->GetBaseUrl() + "/hello.html"}; std::shared_ptr<Session> session = std::make_shared<Session>(); session->SetUrl(url); multiperform.AddSession(session); std::vector<Response> responses = multiperform.Get(); EXPECT_EQ(responses.size(), 1); std::string expected_text{"Hello world!"}; EXPECT_EQ(expected_text, responses.at(0).text); EXPECT_EQ(url, responses.at(0).url); EXPECT_EQ(std::string{"text/html"}, responses.at(0).header["content-type"]); EXPECT_EQ(200, responses.at(0).status_code); EXPECT_EQ(ErrorCode::OK, responses.at(0).error.code); } { Url url{server->GetBaseUrl() + "/hello.html"}; std::shared_ptr<Session> session = std::make_shared<Session>(); session->SetUrl(url); multiperform = MultiPerform(); // This line does not work if the Muliperform object was used before multiperform.AddSession(session); std::vector<Response> responses = multiperform.Get(); EXPECT_EQ(responses.size(), 1); std::string expected_text{"Hello world!"}; EXPECT_EQ(expected_text, responses.at(0).text); EXPECT_EQ(url, responses.at(0).url); EXPECT_EQ(std::string{"text/html"}, responses.at(0).header["content-type"]); EXPECT_EQ(200, responses.at(0).status_code); EXPECT_EQ(ErrorCode::OK, responses.at(0).error.code); } } Running it leads to a segmentation fault in Line 361 of `multiperform.cpp`. 
Reset everything during assignment operator.
GitHub (branch e.g. master)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
cpr::Multiperform
assignment is broken once the object has been used before.Workaround:
Use a
std::uniqe_ptr
aroundcpr::Multiperform
.Example/How to Reproduce
Take this test case:
Possible Fix
Reset everything during assignment operator.
Where did you get it from?
GitHub (branch e.g. master)
Additional Context/Your Environment
The text was updated successfully, but these errors were encountered: