h2load: Always initialize timeout_watcher

This commit is contained in:
Tatsuhiro Tsujikawa 2015-08-11 23:44:22 +09:00
parent 81add96b1e
commit 0f7e84bb62
1 changed files with 5 additions and 5 deletions

View File

@ -737,11 +737,11 @@ Worker::Worker(uint32_t id, SSL_CTX *ssl_ctx, size_t req_todo, size_t nclients,
auto nreqs_per_client = req_todo / nclients; auto nreqs_per_client = req_todo / nclients;
auto nreqs_rem = req_todo % nclients; auto nreqs_rem = req_todo % nclients;
if (config->is_rate_mode()) {
// create timer that will go off every second // create timer that will go off every second
ev_timer_init(&timeout_watcher, second_timeout_w_cb, 0., 1.); ev_timer_init(&timeout_watcher, second_timeout_w_cb, 0., 1.);
timeout_watcher.data = this; timeout_watcher.data = this;
} else {
if (!config->is_rate_mode()) {
for (size_t i = 0; i < nclients; ++i) { for (size_t i = 0; i < nclients; ++i) {
auto req_todo = nreqs_per_client; auto req_todo = nreqs_per_client;
if (nreqs_rem > 0) { if (nreqs_rem > 0) {