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
1ca64788
Commit
1ca64788
authored
Oct 10, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h2load: Use duration syntax for timeouts
parent
eb3505af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
src/h2load.cc
src/h2load.cc
+23
-23
src/h2load.h
src/h2load.h
+2
-2
No files found.
src/h2load.cc
View file @
1ca64788
...
...
@@ -74,8 +74,8 @@ namespace h2load {
Config
::
Config
()
:
data_length
(
-
1
),
addrs
(
nullptr
),
nreqs
(
1
),
nclients
(
1
),
nthreads
(
1
),
max_concurrent_streams
(
-
1
),
window_bits
(
30
),
connection_window_bits
(
30
),
rate
(
0
),
rate_period
(
1.0
),
conn_active_timeout
(
0
),
conn_inactivity_timeout
(
0
),
no_tls_proto
(
PROTO_HTTP2
),
data_fd
(
-
1
),
rate
(
0
),
rate_period
(
1.0
),
conn_active_timeout
(
0
.
),
conn_inactivity_timeout
(
0
.
),
no_tls_proto
(
PROTO_HTTP2
),
data_fd
(
-
1
),
port
(
0
),
default_port
(
0
),
verbose
(
false
),
timing_script
(
false
)
{}
Config
::~
Config
()
{
...
...
@@ -296,7 +296,7 @@ int Client::connect() {
record_start_time
(
&
worker
->
stats
);
if
(
worker
->
config
->
conn_inactivity_timeout
>
0
)
{
if
(
worker
->
config
->
conn_inactivity_timeout
>
0
.
)
{
ev_timer_again
(
worker
->
loop
,
&
conn_inactivity_watcher
);
}
...
...
@@ -342,7 +342,7 @@ void Client::timeout() {
}
void
Client
::
restart_timeout
()
{
if
(
worker
->
config
->
conn_inactivity_timeout
>
0
)
{
if
(
worker
->
config
->
conn_inactivity_timeout
>
0
.
)
{
ev_timer_again
(
worker
->
loop
,
&
conn_inactivity_watcher
);
}
}
...
...
@@ -395,7 +395,7 @@ void Client::submit_request() {
// if an active timeout is set and this is the last request to be submitted
// on this connection, start the active timeout.
if
(
worker
->
config
->
conn_active_timeout
>
0
&&
req_started
>=
req_todo
)
{
if
(
worker
->
config
->
conn_active_timeout
>
0
.
&&
req_started
>=
req_todo
)
{
ev_timer_start
(
worker
->
loop
,
&
conn_active_watcher
);
}
}
...
...
@@ -1385,20 +1385,20 @@ Options:
length of the period in time. This option is ignored if
the rate option is not used. The default value for this
option is 1s.
-T, --connection-active-timeout=<N>
-T, --connection-active-timeout=<
DURATIO
N>
Specifies the maximum time that h2load is willing to
keep a connection open, regardless of the activity on
said
connection. <N> must be a positive
integer,
specifying
the number of seconds to wait. When no
timeout value is set (either active or inactive), h2load
will keep a connection open indefinitely, waiting for
a
said
connection. <DURATION> must be a positive
integer,
specifying
the amount of time to wait. When no timeout
value is set (either active or inactive), h2load will
keep a connection open indefinitely, waiting for
a
response.
-N, --connection-inactivity-timeout=<N>
-N, --connection-inactivity-timeout=<
DURATIO
N>
Specifies the amount of time that h2load is willing to
wait to see activity
on a given connection. <N> must be
a positive integer, specifying the number of seconds to
wait. When no timeout value is set (either active o
r
inactive), h2load will keep a connection
open
wait to see activity
on a given connection. <DURATION>
must be a positive integer, specifying the amount of
time to wait. When no timeout value is set (eithe
r
active or inactive), h2load will keep a connection
open
indefinitely, waiting for a response.
--timing-script-file=<PATH>
Path of a file containing one or more lines separated by
...
...
@@ -1586,18 +1586,18 @@ int main(int argc, char **argv) {
}
break
;
case
'T'
:
config
.
conn_active_timeout
=
strtoul
(
optarg
,
nullptr
,
10
);
if
(
config
.
conn_active_timeout
<=
0
)
{
std
::
cerr
<<
"-T:
the conn_active_timeout wait time
"
<<
"must be positive."
<<
std
::
endl
;
config
.
conn_active_timeout
=
util
::
parse_duration_with_unit
(
optarg
);
if
(
!
std
::
isfinite
(
config
.
conn_active_timeout
)
)
{
std
::
cerr
<<
"-T:
bad value for the conn_active_timeout wait time:
"
<<
optarg
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
break
;
case
'N'
:
config
.
conn_inactivity_timeout
=
strtoul
(
optarg
,
nullptr
,
10
);
if
(
config
.
conn_inactivity_timeout
<=
0
)
{
std
::
cerr
<<
"-N:
the conn_inactivity_timeout wait time
"
<<
"must be positive."
<<
std
::
endl
;
config
.
conn_inactivity_timeout
=
util
::
parse_duration_with_unit
(
optarg
);
if
(
!
std
::
isfinite
(
config
.
conn_inactivity_timeout
)
)
{
std
::
cerr
<<
"-N:
bad value for the conn_inactivity_timeout wait time:
"
<<
optarg
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
break
;
...
...
src/h2load.h
View file @
1ca64788
...
...
@@ -83,9 +83,9 @@ struct Config {
size_t
rate
;
ev_tstamp
rate_period
;
// amount of time to wait for activity on a given connection
ssize_t
conn_active_timeout
;
ev_tstamp
conn_active_timeout
;
// amount of time to wait after the last request is made on a connection
ssize_t
conn_inactivity_timeout
;
ev_tstamp
conn_inactivity_timeout
;
enum
{
PROTO_HTTP2
,
PROTO_SPDY2
,
...
...
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