diff --git a/src/h2load.cc b/src/h2load.cc index a925839f..2c42557b 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -551,11 +551,11 @@ std::string get_reqline(const char *uri, const http_parser_url& u) } // namespace namespace { -std::unique_ptr run(std::unique_ptr worker) +Stats run(std::unique_ptr worker) { worker->run(); - return worker; + return worker->stats; } } // namespace @@ -898,7 +898,7 @@ int main(int argc, char **argv) std::cout << "starting benchmark..." << std::endl; - std::vector>> futures; + std::vector> futures; auto start = std::chrono::steady_clock::now(); std::vector> workers; @@ -924,8 +924,7 @@ int main(int argc, char **argv) worker.run(); for(auto& fut : futures) { - auto subworker = fut.get(); - auto& stats = subworker->stats; + auto stats = fut.get(); worker.stats.req_todo += stats.req_todo; worker.stats.req_started += stats.req_started;