Skip to content

Commit

Permalink
Reduced the number of async connect executions for better windows com…
Browse files Browse the repository at this point in the history
…patibility

With more connections you would get COULDNT_CONNECT on Windows.
  • Loading branch information
COM8 committed Sep 28, 2024
1 parent f44c424 commit b98838e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/async_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ TEST(AsyncTests, AsyncGetMultipleTest) {
TEST(AsyncTests, AsyncGetMultipleReflectTest) {
Url url{server->GetBaseUrl() + "/hello.html"};
std::vector<AsyncResponse> responses;
for (size_t i = 0; i < 100; ++i) {
for (size_t i = 0; i < 25; ++i) {
Parameters p{{"key", std::to_string(i)}};
responses.emplace_back(cpr::GetAsync(url, p));
}
Expand All @@ -61,6 +61,7 @@ TEST(AsyncTests, AsyncGetMultipleReflectTest) {
EXPECT_EQ(expected_url, response.url);
EXPECT_EQ(std::string{"text/html"}, response.header["content-type"]);
EXPECT_EQ(200, response.status_code);
EXPECT_EQ(response.error.code, cpr::ErrorCode::OK);
++i;
}
}
Expand Down

0 comments on commit b98838e

Please sign in to comment.