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
502b552b
Commit
502b552b
authored
Feb 08, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Add --no-server-push option
parent
8c90e531
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
1 deletion
+21
-1
src/shrpx.cc
src/shrpx.cc
+10
-0
src/shrpx_config.cc
src/shrpx_config.cc
+7
-0
src/shrpx_config.h
src/shrpx_config.h
+2
-0
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+2
-1
No files found.
src/shrpx.cc
View file @
502b552b
...
...
@@ -782,6 +782,7 @@ void fill_default_config() {
mod_config
()
->
tls_ctx_per_worker
=
false
;
mod_config
()
->
downstream_request_buffer_size
=
16
*
1024
;
mod_config
()
->
downstream_response_buffer_size
=
16
*
1024
;
mod_config
()
->
no_server_push
=
false
;
}
}
// namespace
...
...
@@ -1087,6 +1088,10 @@ HTTP/2 and SPDY:
padding. Specify 0 to disable padding. This option is
meant for debugging purpose and not intended to enhance
protocol security.
--no-server-push
Disable HTTP/2 server push. Server push is only
supported by default mode and HTTP/2 frontend. SPDY
frontend does not support server push.
Mode:
(default mode)
...
...
@@ -1345,6 +1350,7 @@ int main(int argc, char **argv) {
{
"backend-response-buffer"
,
required_argument
,
&
flag
,
71
},
{
"backend-request-buffer"
,
required_argument
,
&
flag
,
72
},
{
"no-host-rewrite"
,
no_argument
,
&
flag
,
73
},
{
"no-server-push"
,
no_argument
,
&
flag
,
74
},
{
nullptr
,
0
,
nullptr
,
0
}};
int
option_index
=
0
;
...
...
@@ -1678,6 +1684,10 @@ int main(int argc, char **argv) {
// --no-host-rewrite
cmdcfgs
.
emplace_back
(
SHRPX_OPT_NO_HOST_REWRITE
,
"yes"
);
break
;
case
74
:
// --no-server-push
cmdcfgs
.
emplace_back
(
SHRPX_OPT_NO_SERVER_PUSH
,
"yes"
);
break
;
default:
break
;
}
...
...
src/shrpx_config.cc
View file @
502b552b
...
...
@@ -145,6 +145,7 @@ const char SHRPX_OPT_RLIMIT_NOFILE[] = "rlimit-nofile";
const
char
SHRPX_OPT_TLS_CTX_PER_WORKER
[]
=
"tls-ctx-per-worker"
;
const
char
SHRPX_OPT_BACKEND_REQUEST_BUFFER
[]
=
"backend-request-buffer"
;
const
char
SHRPX_OPT_BACKEND_RESPONSE_BUFFER
[]
=
"backend-response-buffer"
;
const
char
SHRPX_OPT_NO_SERVER_PUSH
[]
=
"no-server-push"
;
namespace
{
Config
*
config
=
nullptr
;
...
...
@@ -1165,6 +1166,12 @@ int parse_config(const char *opt, const char *optarg) {
return
0
;
}
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_NO_SERVER_PUSH
))
{
mod_config
()
->
no_server_push
=
util
::
strieq
(
optarg
,
"yes"
);
return
0
;
}
if
(
util
::
strieq
(
opt
,
"conf"
))
{
LOG
(
WARN
)
<<
"conf: ignored"
;
...
...
src/shrpx_config.h
View file @
502b552b
...
...
@@ -132,6 +132,7 @@ extern const char SHRPX_OPT_RLIMIT_NOFILE[];
extern
const
char
SHRPX_OPT_TLS_CTX_PER_WORKER
[];
extern
const
char
SHRPX_OPT_BACKEND_REQUEST_BUFFER
[];
extern
const
char
SHRPX_OPT_BACKEND_RESPONSE_BUFFER
[];
extern
const
char
SHRPX_OPT_NO_SERVER_PUSH
[];
union
sockaddr_union
{
sockaddr_storage
storage
;
...
...
@@ -304,6 +305,7 @@ struct Config {
bool
no_host_rewrite
;
bool
auto_tls_ticket_key
;
bool
tls_ctx_per_worker
;
bool
no_server_push
;
};
const
Config
*
get_config
();
...
...
src/shrpx_http2_upstream.cc
View file @
502b552b
...
...
@@ -1336,7 +1336,8 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) {
// * We requires GET or POST for associated resource. Probably we
// don't want to push for HEAD request. Not sure other methods
// are also eligible for push.
if
(
get_config
()
->
downstream_proto
==
PROTO_HTTP
&&
if
(
!
get_config
()
->
no_server_push
&&
get_config
()
->
downstream_proto
==
PROTO_HTTP
&&
!
get_config
()
->
http2_proxy
&&
(
downstream
->
get_stream_id
()
%
2
)
&&
downstream
->
get_response_header
(
http2
::
HD_LINK
)
&&
downstream
->
get_response_http_status
()
==
200
&&
...
...
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