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
5b195092
Commit
5b195092
authored
Jan 27, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpd: Add -w and -W options to change window size
parent
85bb37ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
1 deletion
+49
-1
src/HttpServer.cc
src/HttpServer.cc
+19
-0
src/HttpServer.h
src/HttpServer.h
+2
-0
src/nghttpd.cc
src/nghttpd.cc
+28
-1
No files found.
src/HttpServer.cc
View file @
5b195092
...
...
@@ -109,6 +109,8 @@ Config::Config()
num_worker
(
1
),
max_concurrent_streams
(
100
),
header_table_size
(
-
1
),
window_bits
(
-
1
),
connection_window_bits
(
-
1
),
port
(
0
),
verbose
(
false
),
daemon
(
false
),
...
...
@@ -845,11 +847,28 @@ int Http2Handler::connection_made() {
entry
[
niv
].
value
=
config
->
header_table_size
;
++
niv
;
}
if
(
config
->
window_bits
!=
-
1
)
{
entry
[
niv
].
settings_id
=
NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE
;
entry
[
niv
].
value
=
(
1
<<
config
->
window_bits
)
-
1
;
++
niv
;
}
r
=
nghttp2_submit_settings
(
session_
,
NGHTTP2_FLAG_NONE
,
entry
.
data
(),
niv
);
if
(
r
!=
0
)
{
return
r
;
}
if
(
config
->
connection_window_bits
!=
-
1
)
{
r
=
nghttp2_submit_window_update
(
session_
,
NGHTTP2_FLAG_NONE
,
0
,
(
1
<<
config
->
connection_window_bits
)
-
1
-
NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE
);
if
(
r
!=
0
)
{
return
r
;
}
}
ev_timer_start
(
sessions_
->
get_loop
(),
&
settings_timerev_
);
if
(
ssl_
&&
!
nghttp2
::
ssl
::
check_http2_requirement
(
ssl_
))
{
...
...
src/HttpServer.h
View file @
5b195092
...
...
@@ -67,6 +67,8 @@ struct Config {
size_t
num_worker
;
size_t
max_concurrent_streams
;
ssize_t
header_table_size
;
int
window_bits
;
int
connection_window_bits
;
uint16_t
port
;
bool
verbose
;
bool
daemon
;
...
...
src/nghttpd.cc
View file @
5b195092
...
...
@@ -143,6 +143,11 @@ Options:
Default: 1
-e, --error-gzip
Make error response gzipped.
-w, --window-bits=<N>
Sets the stream level initial window size to 2**<N>-1.
-W, --connection-window-bits=<N>
Sets the connection level initial window size to
2**<N>-1.
--dh-param-file=<PATH>
Path to file that contains DH parameters in PEM format.
Without this option, DHE cipher suites are not
...
...
@@ -202,6 +207,8 @@ int main(int argc, char **argv) {
{
"max-concurrent-streams"
,
required_argument
,
nullptr
,
'm'
},
{
"workers"
,
required_argument
,
nullptr
,
'n'
},
{
"error-gzip"
,
no_argument
,
nullptr
,
'e'
},
{
"window-bits"
,
required_argument
,
nullptr
,
'w'
},
{
"connection-window-bits"
,
required_argument
,
nullptr
,
'W'
},
{
"no-tls"
,
no_argument
,
&
flag
,
1
},
{
"color"
,
no_argument
,
&
flag
,
2
},
{
"version"
,
no_argument
,
&
flag
,
3
},
...
...
@@ -214,7 +221,7 @@ int main(int argc, char **argv) {
{
"no-content-length"
,
no_argument
,
&
flag
,
10
},
{
nullptr
,
0
,
nullptr
,
0
}};
int
option_index
=
0
;
int
c
=
getopt_long
(
argc
,
argv
,
"DVb:c:d:ehm:n:p:va:"
,
long_options
,
int
c
=
getopt_long
(
argc
,
argv
,
"DVb:c:d:ehm:n:p:va:
w:W:
"
,
long_options
,
&
option_index
);
char
*
end
;
if
(
c
==
-
1
)
{
...
...
@@ -281,6 +288,26 @@ int main(int argc, char **argv) {
std
::
cerr
<<
"-p: Bad option value: "
<<
optarg
<<
std
::
endl
;
}
break
;
case
'w'
:
case
'W'
:
{
char
*
endptr
;
errno
=
0
;
auto
n
=
strtoul
(
optarg
,
&
endptr
,
10
);
if
(
errno
!=
0
||
*
endptr
!=
'\0'
||
n
>=
31
)
{
std
::
cerr
<<
"-"
<<
static_cast
<
char
>
(
c
)
<<
": specify the integer in the range [0, 30], inclusive"
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
if
(
c
==
'w'
)
{
config
.
window_bits
=
n
;
}
else
{
config
.
connection_window_bits
=
n
;
}
break
;
}
case
'?'
:
util
::
show_candidates
(
argv
[
optind
-
1
],
long_options
);
exit
(
EXIT_FAILURE
);
...
...
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