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
f92f81c0
Commit
f92f81c0
authored
Nov 13, 2021
by
robaho
Committed by
Tatsuhiro Tsujikawa
Nov 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow setting max frame size for h2load
parent
3c4449c0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
src/h2load.cc
src/h2load.cc
+26
-1
src/h2load.h
src/h2load.h
+1
-0
src/h2load_http2_session.cc
src/h2load_http2_session.cc
+6
-1
No files found.
src/h2load.cc
View file @
f92f81c0
...
...
@@ -106,6 +106,7 @@ Config::Config()
max_concurrent_streams
(
1
),
window_bits
(
30
),
connection_window_bits
(
30
),
max_frame_size
(
16
_k
),
rate
(
0
),
rate_period
(
1.0
),
duration
(
0.0
),
...
...
@@ -2109,6 +2110,11 @@ Options:
http/1.1 is used, this specifies the number of HTTP
pipelining requests in-flight.
Default: 1
-f, --max-frame-size=<SIZE>
Maximum frame size that the local endpoint is willing to
receive.
Default: )"
<<
util
::
utos_unit
(
config
.
max_frame_size
)
<<
R"(
-w, --window-bits=<N>
Sets the stream level initial window size to (2**<N>)-1.
For QUIC, <N> is capped to 26 (roughly 64MiB).
...
...
@@ -2301,6 +2307,7 @@ int main(int argc, char **argv) {
{
"threads"
,
required_argument
,
nullptr
,
't'
},
{
"max-concurrent-streams"
,
required_argument
,
nullptr
,
'm'
},
{
"window-bits"
,
required_argument
,
nullptr
,
'w'
},
{
"max-frame-size"
,
required_argument
,
nullptr
,
'f'
},
{
"connection-window-bits"
,
required_argument
,
nullptr
,
'W'
},
{
"input-file"
,
required_argument
,
nullptr
,
'i'
},
{
"header"
,
required_argument
,
nullptr
,
'H'
},
...
...
@@ -2332,7 +2339,7 @@ int main(int argc, char **argv) {
{
nullptr
,
0
,
nullptr
,
0
}};
int
option_index
=
0
;
auto
c
=
getopt_long
(
argc
,
argv
,
"hvW:c:d:m:n:p:t:w:H:i:r:T:N:D:B:"
,
long_options
,
"hvW:c:d:m:n:p:t:w:
f:
H:i:r:T:N:D:B:"
,
long_options
,
&
option_index
);
if
(
c
==
-
1
)
{
break
;
...
...
@@ -2378,6 +2385,24 @@ int main(int argc, char **argv) {
}
break
;
}
case
'f'
:
{
auto
n
=
util
::
parse_uint_with_unit
(
optarg
);
if
(
n
==
-
1
)
{
std
::
cerr
<<
"--max-frame-size: bad option value: "
<<
optarg
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
if
(
static_cast
<
uint64_t
>
(
n
)
<
16
_k
)
{
std
::
cerr
<<
"--max-frame-size: minimum 16384"
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
if
(
static_cast
<
uint64_t
>
(
n
)
>
16
_m
-
1
)
{
std
::
cerr
<<
"--max-frame-size: maximum 16777215"
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
config
.
max_frame_size
=
n
;
break
;
}
case
'H'
:
{
char
*
header
=
optarg
;
// Skip first possible ':' in the header name
...
...
src/h2load.h
View file @
f92f81c0
...
...
@@ -95,6 +95,7 @@ struct Config {
ssize_t
max_concurrent_streams
;
size_t
window_bits
;
size_t
connection_window_bits
;
size_t
max_frame_size
;
// rate at which connections should be made
size_t
rate
;
ev_tstamp
rate_period
;
...
...
src/h2load_http2_session.cc
View file @
f92f81c0
...
...
@@ -215,7 +215,7 @@ void Http2Session::on_connect() {
nghttp2_option_del
(
opt
);
std
::
array
<
nghttp2_settings_entry
,
3
>
iv
;
std
::
array
<
nghttp2_settings_entry
,
4
>
iv
;
size_t
niv
=
2
;
iv
[
0
].
settings_id
=
NGHTTP2_SETTINGS_ENABLE_PUSH
;
iv
[
0
].
value
=
0
;
...
...
@@ -227,6 +227,11 @@ void Http2Session::on_connect() {
iv
[
niv
].
value
=
config
->
header_table_size
;
++
niv
;
}
if
(
config
->
max_frame_size
!=
16
_k
)
{
iv
[
niv
].
settings_id
=
NGHTTP2_SETTINGS_MAX_FRAME_SIZE
;
iv
[
niv
].
value
=
config
->
max_frame_size
;
++
niv
;
}
rv
=
nghttp2_submit_settings
(
session_
,
NGHTTP2_FLAG_NONE
,
iv
.
data
(),
niv
);
...
...
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