h2load: Fix division by zero if -r > -n

This commit is contained in:
Tatsuhiro Tsujikawa 2015-08-11 23:49:34 +09:00
parent 0f7e84bb62
commit dd97b53554
1 changed files with 6 additions and 0 deletions

View File

@ -1320,6 +1320,12 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
if (config.rate > config.nreqs) {
std::cerr << "-r, -n: the connection rate must be smaller than or equal "
"to the number of requests." << std::endl;
exit(EXIT_FAILURE);
}
if (config.nconns != 0 && config.nconns < config.nthreads) {
std::cerr
<< "-C, -t: the total number of connections must be greater than "