Fixed io_test (out of stack?), also fixed concurrent sync requests count on request error.

This commit is contained in:
eidheim 2017-07-07 17:36:27 +02:00
commit 06d3c701e1
3 changed files with 20 additions and 14 deletions

View file

@ -241,7 +241,6 @@ int main() {
vector<int> calls(100, 0);
vector<thread> threads;
for(size_t c = 0; c < 100; ++c) {
calls[c] = 0;
threads.emplace_back([c, &client, &calls] {
client.request("GET", "/match/123", [c, &calls](shared_ptr<HttpClient::Response> response, const SimpleWeb::error_code &ec) {
assert(!ec);
@ -267,10 +266,9 @@ int main() {
{
HttpClient client("localhost:8080");
{
vector<int> calls(100, 0);
vector<int> calls(2, 0);
vector<thread> threads;
for(size_t c = 0; c < 100; ++c) {
calls[c] = 0;
for(size_t c = 0; c < 2; ++c) {
threads.emplace_back([c, &client, &calls] {
try {
auto r = client.request("GET", "/match/123");