Bug #11302 » 0003-Add-test-for-use-after-free-race-on-listener-close.patch
| test/http/HttpClientServerTest.C | ||
|---|---|---|
|
return impl_.start();
|
||
|
}
|
||
|
void stop()
|
||
|
{
|
||
|
impl_.start();
|
||
|
}
|
||
|
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
|
||