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
c88a5291
Commit
c88a5291
authored
Jan 13, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Add --backend-response-buffer option
parent
0d614cf1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
1 deletion
+32
-1
src/shrpx.cc
src/shrpx.cc
+11
-0
src/shrpx_config.cc
src/shrpx_config.cc
+17
-0
src/shrpx_config.h
src/shrpx_config.h
+2
-0
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+2
-1
No files found.
src/shrpx.cc
View file @
c88a5291
...
...
@@ -747,6 +747,7 @@ void fill_default_config() {
mod_config
()
->
listener_disable_timeout
=
0.
;
mod_config
()
->
auto_tls_ticket_key
=
true
;
mod_config
()
->
tls_ctx_per_worker
=
false
;
mod_config
()
->
downstream_response_buffer_size
=
64
*
1024
;
}
}
// namespace
...
...
@@ -877,6 +878,11 @@ Performance:
Set maximum number of open files (RLIMIT_NOFILE) to <N>.
If 0 is given, nghttpx does not set the limit.
Default: )"
<<
get_config
()
->
rlimit_nofile
<<
R"(
--backend-response-buffer=<SIZE>
Set buffer size used to store backend response.
Default: )"
<<
util
::
utos_with_unit
(
get_config
()
->
downstream_response_buffer_size
)
<<
R"(
Timeout:
--frontend-http2-read-timeout=<SEC>
...
...
@@ -1273,6 +1279,7 @@ int main(int argc, char **argv) {
{
"tls-ticket-key-file"
,
required_argument
,
&
flag
,
68
},
{
"rlimit-nofile"
,
required_argument
,
&
flag
,
69
},
{
"tls-ctx-per-worker"
,
no_argument
,
&
flag
,
70
},
{
"backend-response-buffer"
,
required_argument
,
&
flag
,
71
},
{
nullptr
,
0
,
nullptr
,
0
}};
int
option_index
=
0
;
...
...
@@ -1594,6 +1601,10 @@ int main(int argc, char **argv) {
// --tls-ctx-per-worker
cmdcfgs
.
emplace_back
(
SHRPX_OPT_TLS_CTX_PER_WORKER
,
"yes"
);
break
;
case
71
:
// --backend-response-buffer
cmdcfgs
.
emplace_back
(
SHRPX_OPT_BACKEND_RESPONSE_BUFFER
,
optarg
);
break
;
default:
break
;
}
...
...
src/shrpx_config.cc
View file @
c88a5291
...
...
@@ -141,6 +141,7 @@ const char SHRPX_OPT_LISTENER_DISABLE_TIMEOUT[] = "listener-disable-timeout";
const
char
SHRPX_OPT_TLS_TICKET_KEY_FILE
[]
=
"tls-ticket-key-file"
;
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_RESPONSE_BUFFER
[]
=
"backend-response-buffer"
;
namespace
{
Config
*
config
=
nullptr
;
...
...
@@ -1130,6 +1131,22 @@ int parse_config(const char *opt, const char *optarg) {
return
0
;
}
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_BACKEND_RESPONSE_BUFFER
))
{
size_t
n
;
if
(
parse_uint_with_unit
(
&
n
,
opt
,
optarg
)
!=
0
)
{
return
-
1
;
}
if
(
n
==
0
)
{
LOG
(
ERROR
)
<<
opt
<<
": specify an integer strictly more than 0"
;
return
-
1
;
}
mod_config
()
->
downstream_response_buffer_size
=
n
;
return
0
;
}
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_TLS_CTX_PER_WORKER
))
{
mod_config
()
->
tls_ctx_per_worker
=
util
::
strieq
(
optarg
,
"yes"
);
...
...
src/shrpx_config.h
View file @
c88a5291
...
...
@@ -129,6 +129,7 @@ extern const char SHRPX_OPT_LISTENER_DISABLE_TIMEOUT[];
extern
const
char
SHRPX_OPT_TLS_TICKET_KEY_FILE
[];
extern
const
char
SHRPX_OPT_RLIMIT_NOFILE
[];
extern
const
char
SHRPX_OPT_TLS_CTX_PER_WORKER
[];
extern
const
char
SHRPX_OPT_BACKEND_RESPONSE_BUFFER
[];
union
sockaddr_union
{
sockaddr
sa
;
...
...
@@ -256,6 +257,7 @@ struct Config {
size_t
padding
;
size_t
worker_frontend_connections
;
size_t
rlimit_nofile
;
size_t
downstream_response_buffer_size
;
// Bit mask to disable SSL/TLS protocol versions. This will be
// passed to SSL_CTX_set_options().
long
int
tls_proto_mask
;
...
...
src/shrpx_downstream.cc
View file @
c88a5291
...
...
@@ -642,7 +642,8 @@ Memchunks4K *Downstream::get_response_buf() { return &response_buf_; }
bool
Downstream
::
response_buf_full
()
{
if
(
dconn_
)
{
return
response_buf_
.
rleft
()
>=
64
*
1024
;
return
response_buf_
.
rleft
()
>=
get_config
()
->
downstream_response_buffer_size
;
}
else
{
return
false
;
}
...
...
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