From 584f5f37343d6566795d60fe14125e45444e6513 Mon Sep 17 00:00:00 2001 From: Nora Shoemaker Date: Thu, 23 Jul 2015 10:37:51 -0700 Subject: [PATCH] Do not allow -r > -t --- src/h2load.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/h2load.cc b/src/h2load.cc index 4ead6d29..856d556f 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -1326,9 +1326,10 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } - if (config.rate != 0 && config.nthreads != 1) { - std::cerr << "-r, -t: warning: the -t option will be ignored when the -r " - << "option is in use." << std::endl; + if (config.is_rate_mode() && config.rate < (ssize_t)config.nthreads) { + std::cerr << "-r, -t: the connection rate must be greater than or equal " + << "to the number of threads." << std::endl; + exit(EXIT_FAILURE); } if (!datafile.empty()) {