Skip to content

Commit

Permalink
Fixed the bug introduce the previous commit(not send any request if none
Browse files Browse the repository at this point in the history
'-r' option).
  • Loading branch information
fangxinmiao committed Apr 2, 2016
1 parent 9cff098 commit 5ab0ca4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/wrk.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,15 @@ int main(int argc, char **argv) {
}

t->connections = cfg.connections / cfg.threads;
t->complete_stop = cfg.requests / cfg.threads;
if (i == (cfg.threads - 1))
t->complete_stop += (cfg.requests % cfg.threads);

t->L = script_create(cfg.script, url, headers);
script_init(L, t, argc - optind, &argv[optind]);

aeSetCheckThreadStopProc(t->loop, aeCheckThreadStop, (void *)t);
if (cfg.requests > 0) {
t->complete_stop = cfg.requests / cfg.threads;
if (i == (cfg.threads - 1))
t->complete_stop += (cfg.requests % cfg.threads);
aeSetCheckThreadStopProc(t->loop, aeCheckThreadStop, (void *)t);
}

if (i == 0) {
cfg.pipeline = script_verify_request(t->L);
Expand Down

0 comments on commit 5ab0ca4

Please sign in to comment.