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
df575f96
Commit
df575f96
authored
Dec 12, 2019
by
lucas
Committed by
Tatsuhiro Tsujikawa
Dec 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h2load: add --connect-to option
parent
1fff7379
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
src/h2load.cc
src/h2load.cc
+12
-2
src/h2load.h
src/h2load.h
+1
-0
No files found.
src/h2load.cc
View file @
df575f96
...
...
@@ -1563,8 +1563,11 @@ void resolve_host() {
hints
.
ai_protocol
=
0
;
hints
.
ai_flags
=
AI_ADDRCONFIG
;
rv
=
getaddrinfo
(
config
.
host
.
c_str
(),
util
::
utos
(
config
.
port
).
c_str
(),
&
hints
,
&
res
);
const
auto
&
resolve_host
=
config
.
connect_to_host
.
empty
()
?
config
.
host
:
config
.
connect_to_host
;
rv
=
getaddrinfo
(
resolve_host
.
c_str
(),
util
::
utos
(
config
.
port
).
c_str
(),
&
hints
,
&
res
);
if
(
rv
!=
0
)
{
std
::
cerr
<<
"getaddrinfo() failed: "
<<
gai_strerror
(
rv
)
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
...
...
@@ -1979,6 +1982,8 @@ Options:
response time when using one worker thread, but may
appear slightly out of order with multiple threads due
to buffering. Status code is -1 for failed streams.
--connect-to=<HOST>
Host to connect instead of using the host in <URI>.
-v, --verbose
Output debug information.
--version Display version information and exit.
...
...
@@ -2037,6 +2042,7 @@ int main(int argc, char **argv) {
{
"encoder-header-table-size"
,
required_argument
,
&
flag
,
8
},
{
"warm-up-time"
,
required_argument
,
&
flag
,
9
},
{
"log-file"
,
required_argument
,
&
flag
,
10
},
{
"connect-to"
,
required_argument
,
&
flag
,
11
},
{
nullptr
,
0
,
nullptr
,
0
}};
int
option_index
=
0
;
auto
c
=
getopt_long
(
argc
,
argv
,
...
...
@@ -2264,6 +2270,10 @@ int main(int argc, char **argv) {
// --log-file
logfile
=
optarg
;
break
;
case
11
:
// --connect-to
config
.
connect_to_host
=
optarg
;
break
;
}
break
;
default:
...
...
src/h2load.h
View file @
df575f96
...
...
@@ -69,6 +69,7 @@ struct Config {
nghttp2
::
Headers
custom_headers
;
std
::
string
scheme
;
std
::
string
host
;
std
::
string
connect_to_host
;
std
::
string
ifile
;
std
::
string
ciphers
;
// length of upload data
...
...
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