Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
a9ecdca0
Commit
a9ecdca0
authored
Oct 22, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h2load: Read URIs from stdin if -i- is used
parent
af5bedd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
16 deletions
+30
-16
src/h2load.cc
src/h2load.cc
+30
-16
No files found.
src/h2load.cc
View file @
a9ecdca0
...
...
@@ -651,6 +651,19 @@ std::vector<std::string> parse_uris(Iterator first, Iterator last)
}
}
// namespace
namespace
{
std
::
vector
<
std
::
string
>
read_uri_from_file
(
std
::
istream
&
infile
)
{
std
::
vector
<
std
::
string
>
uris
;
std
::
string
line_uri
;
while
(
std
::
getline
(
infile
,
line_uri
))
{
uris
.
push_back
(
line_uri
);
}
return
uris
;
}
}
// namespace
namespace
{
void
print_version
(
std
::
ostream
&
out
)
{
...
...
@@ -690,12 +703,13 @@ Options:
-i, --input-file=<FILE>
Path of a file with multiple URIs are seperated
by EOLs. This option will disable URIs getting
from command-line. URIs are used in this order
for each client. All URIs are used, then first
URI is used and then 2nd URI, and so on. The
scheme, host and port in the subsequent URIs, if
present, are ignored. Those in the first URI are
used solely.
from command-line. If '-' is given as <FILE>,
URIs will be read from stdin. URIs are used in
this order for each client. All URIs are used,
then first URI is used and then 2nd URI, and so
on. The scheme, host and port in the subsequent
URIs, if present, are ignored. Those in the
first URI are used solely.
-m, --max-concurrent-streams=(auto|<N>)
Max concurrent streams to issue per session. If
"auto" is given, the number of given URIs is
...
...
@@ -932,17 +946,17 @@ int main(int argc, char **argv)
std
::
copy
(
&
argv
[
optind
],
&
argv
[
argc
],
std
::
back_inserter
(
uris
));
reqlines
=
parse_uris
(
std
::
begin
(
uris
),
std
::
end
(
uris
));
}
else
{
std
::
ifstream
uri_file
(
config
.
ifile
);
if
(
!
uri_file
)
{
std
::
cerr
<<
"cannot read input file: "
<<
config
.
ifile
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
std
::
vector
<
std
::
string
>
uris
;
std
::
string
line_uri
;
while
(
std
::
getline
(
uri_file
,
line_uri
))
{
uris
.
push_back
(
line_uri
);
if
(
config
.
ifile
==
"-"
)
{
uris
=
read_uri_from_file
(
std
::
cin
);
}
else
{
std
::
ifstream
infile
(
config
.
ifile
);
if
(
!
infile
)
{
std
::
cerr
<<
"cannot read input file: "
<<
config
.
ifile
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
uris
=
read_uri_from_file
(
infile
);
}
reqlines
=
parse_uris
(
std
::
begin
(
uris
),
std
::
end
(
uris
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment