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
be5d0864
Commit
be5d0864
authored
Nov 05, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpd: Add -c, --header-table-size option
parent
d92a161c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
src/HttpServer.cc
src/HttpServer.cc
+8
-2
src/HttpServer.h
src/HttpServer.h
+1
-0
src/nghttpd.cc
src/nghttpd.cc
+12
-1
No files found.
src/HttpServer.cc
View file @
be5d0864
...
...
@@ -73,7 +73,8 @@ Config::Config()
verify_client
(
false
),
no_tls
(
false
),
no_flow_control
(
false
),
output_upper_thres
(
1024
*
1024
)
output_upper_thres
(
1024
*
1024
),
header_table_size
(
-
1
)
{}
Request
::
Request
(
int32_t
stream_id
)
...
...
@@ -362,7 +363,7 @@ int Http2Handler::on_connect()
if
(
r
!=
0
)
{
return
r
;
}
nghttp2_settings_entry
entry
[
2
];
nghttp2_settings_entry
entry
[
3
];
size_t
niv
=
1
;
entry
[
0
].
settings_id
=
NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS
;
entry
[
0
].
value
=
100
;
...
...
@@ -371,6 +372,11 @@ int Http2Handler::on_connect()
entry
[
niv
].
value
=
1
;
++
niv
;
}
if
(
config
.
header_table_size
>=
0
)
{
entry
[
niv
].
settings_id
=
NGHTTP2_SETTINGS_HEADER_TABLE_SIZE
;
entry
[
niv
].
value
=
config
.
header_table_size
;
++
niv
;
}
r
=
nghttp2_submit_settings
(
session_
,
NGHTTP2_FLAG_NONE
,
entry
,
niv
);
if
(
r
!=
0
)
{
return
r
;
...
...
src/HttpServer.h
View file @
be5d0864
...
...
@@ -60,6 +60,7 @@ struct Config {
bool
no_tls
;
bool
no_flow_control
;
size_t
output_upper_thres
;
ssize_t
header_table_size
;
Config
();
};
...
...
src/nghttpd.cc
View file @
be5d0864
...
...
@@ -76,6 +76,8 @@ void print_help(std::ostream& out)
<<
" -f, --no-flow-control
\n
"
<<
" Disables connection and stream level flow
\n
"
<<
" controls.
\n
"
<<
" -c, --header-table-size=<N>
\n
"
<<
" Specify decoder header table size.
\n
"
<<
" --color Force colored log output.
\n
"
<<
" -h, --help Print this help.
\n
"
<<
std
::
endl
;
...
...
@@ -95,12 +97,14 @@ int main(int argc, char **argv)
{
"verbose"
,
no_argument
,
nullptr
,
'v'
},
{
"verify-client"
,
no_argument
,
nullptr
,
'V'
},
{
"no-flow-control"
,
no_argument
,
nullptr
,
'f'
},
{
"header-table-size"
,
required_argument
,
nullptr
,
'c'
},
{
"no-tls"
,
no_argument
,
&
flag
,
1
},
{
"color"
,
no_argument
,
&
flag
,
2
},
{
nullptr
,
0
,
nullptr
,
0
}
};
int
option_index
=
0
;
int
c
=
getopt_long
(
argc
,
argv
,
"DVd:fhv"
,
long_options
,
&
option_index
);
int
c
=
getopt_long
(
argc
,
argv
,
"DVc:d:fhv"
,
long_options
,
&
option_index
);
char
*
end
;
if
(
c
==
-
1
)
{
break
;
}
...
...
@@ -123,6 +127,13 @@ int main(int argc, char **argv)
case
'v'
:
config
.
verbose
=
true
;
break
;
case
'c'
:
config
.
header_table_size
=
strtol
(
optarg
,
&
end
,
10
);
if
(
errno
==
ERANGE
||
*
end
!=
'\0'
)
{
std
::
cerr
<<
"-c: Bad option value: "
<<
optarg
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
break
;
case
'?'
:
exit
(
EXIT_FAILURE
);
case
0
:
...
...
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