Commit dd0a7257 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Merge branch 'LPardue-issue-339'

parents e2557059 e7bc269e
...@@ -1161,9 +1161,14 @@ void read_script_from_file(std::istream &infile, ...@@ -1161,9 +1161,14 @@ void read_script_from_file(std::istream &infile,
char *end; char *end;
auto v = std::strtod(start, &end); auto v = std::strtod(start, &end);
if (end == start || errno != 0) { errno = 0;
if (v < 0.0 || !std::isfinite(v) || end == start || errno != 0) {
auto error = errno;
std::cerr << "Time value error at line " << line_count << ". \n\t" std::cerr << "Time value error at line " << line_count << ". \n\t"
<< script_line.substr(0, pos) << std::endl; << "value = " << script_line.substr(0, pos) << std::endl;
if (error != 0) {
std::cerr << "\t" << strerror(error) << std::endl;
}
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -1292,15 +1297,15 @@ Options: ...@@ -1292,15 +1297,15 @@ Options:
Path of a file containing one or more lines separated by Path of a file containing one or more lines separated by
EOLs. Each script line is composed of two tab-separated EOLs. Each script line is composed of two tab-separated
fields. The first field represents the time offset from fields. The first field represents the time offset from
the start of execution, expressed as milliseconds with the start of execution, expressed as a positive value of
microsecond resolution. The second field represents the milliseconds with microsecond resolution. The second
URI. This option will disable URIs getting from field represents the URI. This option will disable URIs
command-line. If '-' is given as <PATH>, script lines getting from command-line. If '-' is given as <PATH>,
will be read from stdin. Script lines are used in order script lines will be read from stdin. Script lines are
for each client. If -n is given, it must be less than used in order for each client. If -n is given, it must be
or equal to the number of script lines, larger values are less than or equal to the number of script lines, larger
clamped to the number of script lines. If -n is values are clamped to the number of script lines. If -n
not given, the number of requests will default to the is not given, the number of requests will default to the
number of script lines. The scheme, host and port defined number of script lines. The scheme, host and port defined
in the first URI are used solely. Values contained in in the first URI are used solely. Values contained in
other URIs, if present, are ignored. Definition of a other URIs, if present, are ignored. Definition of a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment