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
d1b8f607
Commit
d1b8f607
authored
Oct 24, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttp: Allow multiple -c option occurrence, and take min and last value
parent
62a8132c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
src/nghttp.cc
src/nghttp.cc
+22
-7
src/nghttp.h
src/nghttp.h
+2
-1
No files found.
src/nghttp.cc
View file @
d1b8f607
...
...
@@ -94,13 +94,15 @@ constexpr auto anchors = std::array<Anchor, 5>{{
}
// namespace
Config
::
Config
()
:
padding
(
0
),
max_concurrent_streams
(
100
),
:
header_table_size
(
-
1
),
min_header_table_size
(
std
::
numeric_limits
<
uint32_t
>::
max
()),
padding
(
0
),
max_concurrent_streams
(
100
),
peer_max_concurrent_streams
(
NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS
),
header_table_size
(
-
1
),
weight
(
NGHTTP2_DEFAULT_WEIGHT
),
multiply
(
1
),
timeout
(
0.
),
window_bits
(
-
1
),
connection_window_bits
(
-
1
),
verbose
(
0
),
null_out
(
false
),
remote_name
(
false
),
get_assets
(
false
),
stat
(
false
),
upgrade
(
false
),
continuation
(
false
),
no_content_length
(
false
),
no_dep
(
false
),
hexdump
(
false
),
no_push
(
false
)
{
weight
(
NGHTTP2_DEFAULT_WEIGHT
),
multiply
(
1
),
timeout
(
0.
),
window_bits
(
-
1
),
connection_window_bits
(
-
1
),
verbose
(
0
),
null_out
(
false
),
remote_name
(
false
),
get_assets
(
false
),
stat
(
false
),
upgrade
(
false
),
continuation
(
false
),
no_content_length
(
false
),
no_dep
(
false
),
hexdump
(
false
),
no_push
(
false
)
{
nghttp2_option_new
(
&
http2_option
);
nghttp2_option_set_peer_max_concurrent_streams
(
http2_option
,
peer_max_concurrent_streams
);
...
...
@@ -768,6 +770,12 @@ size_t populate_settings(nghttp2_settings_entry *iv) {
}
if
(
config
.
header_table_size
>=
0
)
{
if
(
config
.
min_header_table_size
<
config
.
header_table_size
)
{
iv
[
niv
].
settings_id
=
NGHTTP2_SETTINGS_HEADER_TABLE_SIZE
;
iv
[
niv
].
value
=
config
.
min_header_table_size
;
++
niv
;
}
iv
[
niv
].
settings_id
=
NGHTTP2_SETTINGS_HEADER_TABLE_SIZE
;
iv
[
niv
].
value
=
config
.
header_table_size
;
++
niv
;
...
...
@@ -2426,7 +2434,12 @@ Options:
remote endpoint as if it is received in SETTINGS frame.
The default is large enough as it is seen as unlimited.
-c, --header-table-size=<SIZE>
Specify decoder header table size.
Specify decoder header table size. If this option is
used multiple times, and the minimum value among the
given values except for last one is strictly less than
the last value, that minimum value is set in SETTINGS
frame payload before the last value, to simulate
multiple header table size change.
-b, --padding=<N>
Add at most <N> bytes to a frame payload as padding.
Specify 0 to disable padding.
...
...
@@ -2622,6 +2635,8 @@ int main(int argc, char **argv) {
std
::
cerr
<<
"-c: Bad option value: "
<<
optarg
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
config
.
min_header_table_size
=
std
::
min
(
config
.
min_header_table_size
,
config
.
header_table_size
);
break
;
case
'?'
:
util
::
show_candidates
(
argv
[
optind
-
1
],
long_options
);
...
...
src/nghttp.h
View file @
d1b8f607
...
...
@@ -69,10 +69,11 @@ struct Config {
std
::
string
datafile
;
std
::
string
harfile
;
nghttp2_option
*
http2_option
;
int64_t
header_table_size
;
int64_t
min_header_table_size
;
size_t
padding
;
size_t
max_concurrent_streams
;
ssize_t
peer_max_concurrent_streams
;
ssize_t
header_table_size
;
int32_t
weight
;
int
multiply
;
// milliseconds
...
...
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