Project

General

Profile

Bug #11302 » 0003-Add-test-for-use-after-free-race-on-listener-close_REV01.patch

Bruce Toll, 02/02/2023 04:15 PM

View differences:

test/http/HttpClientServerTest.C
return impl_.start();
}
void stop()
{
impl_.stop();
}
Configuration& configuration()
{
return impl_.configuration();
......
}
}
BOOST_AUTO_TEST_CASE( http_server_clean_close )
{
constexpr unsigned ClientCount {1000};
Server server;
server.resource().setType(TestType::Continuation);
server.resource().simulateWork();
if (server.start()) {
std::vector<Client *> clients;
for (unsigned i = 0; i < ClientCount; ++i) {
Client *client = new Client();
client->get("http://" + server.address() + "/test");
clients.push_back(client);
}
server.stop();
for (unsigned i = 0; i < ClientCount; ++i) {
clients[i]->waitDone();
delete clients[i];
}
}
}
#endif // WT_THREADED
(4-4/8)