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
72877379
Commit
72877379
authored
Feb 13, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Deprecate --backend-ipv4 and --backend-ipv6 in favor of --backend-address-family
parent
84499584
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
22 deletions
+37
-22
gennghttpxfun.py
gennghttpxfun.py
+1
-0
src/shrpx.cc
src/shrpx.cc
+14
-15
src/shrpx_config.cc
src/shrpx_config.cc
+17
-2
src/shrpx_config.h
src/shrpx_config.h
+5
-5
No files found.
gennghttpxfun.py
View file @
72877379
...
...
@@ -123,6 +123,7 @@ OPTIONS = [
"tls-ticket-key-memcached-cert-file"
,
"tls-ticket-key-memcached-private-key-file"
,
"tls-ticket-key-memcached-address-family"
,
"backend-address-family"
]
LOGVARS
=
[
...
...
src/shrpx.cc
View file @
72877379
...
...
@@ -1166,6 +1166,7 @@ void fill_default_config() {
downstreamconf
.
connections_per_host
=
8
;
downstreamconf
.
request_buffer_size
=
16
_k
;
downstreamconf
.
response_buffer_size
=
128
_k
;
downstreamconf
.
family
=
AF_UNSPEC
;
}
}
...
...
@@ -1270,10 +1271,12 @@ Connections:
--backlog=<N>
Set listen backlog size.
Default: )"
<<
get_config
()
->
conn
.
listener
.
backlog
<<
R"(
--backend-ipv4
Resolve backend hostname to IPv4 address only.
--backend-ipv6
Resolve backend hostname to IPv6 address only.
--backend-address-family=(auto|IPv4|IPv6)
Specify address family of backend connections. If
"auto" is given, both IPv4 and IPv6 are considered. If
"IPv4" is given, only IPv4 address is considered. If
"IPv6" is given, only IPv6 address is considered.
Default: auto
--backend-http-proxy-uri=<URI>
Specify proxy URI in the form
http://[<USER>:<PASS>@]<PROXY>:<PORT>. If a proxy
...
...
@@ -2055,12 +2058,6 @@ void process_options(
listenerconf
.
addrs
.
push_back
(
std
::
move
(
addr
));
}
if
(
downstreamconf
.
ipv4
&&
downstreamconf
.
ipv6
)
{
LOG
(
FATAL
)
<<
"--backend-ipv4 and --backend-ipv6 cannot be used at the "
<<
"same time."
;
exit
(
EXIT_FAILURE
);
}
if
(
upstreamconf
.
worker_connections
==
0
)
{
upstreamconf
.
worker_connections
=
std
::
numeric_limits
<
size_t
>::
max
();
}
...
...
@@ -2195,11 +2192,8 @@ void process_options(
addr
.
hostport
=
ImmutableString
(
util
::
make_hostport
(
addr
.
host
.
c_str
(),
addr
.
port
));
if
(
resolve_hostname
(
&
addr
.
addr
,
addr
.
host
.
c_str
(),
addr
.
port
,
downstreamconf
.
ipv4
?
AF_INET
:
(
downstreamconf
.
ipv6
?
AF_INET6
:
AF_UNSPEC
))
==
-
1
)
{
if
(
resolve_hostname
(
&
addr
.
addr
,
addr
.
host
.
c_str
(),
addr
.
port
,
downstreamconf
.
family
)
==
-
1
)
{
exit
(
EXIT_FAILURE
);
}
}
...
...
@@ -2453,6 +2447,7 @@ int main(int argc, char **argv) {
&
flag
,
114
},
{
SHRPX_OPT_TLS_SESSION_CACHE_MEMCACHED_ADDRESS_FAMILY
,
required_argument
,
&
flag
,
115
},
{
SHRPX_OPT_BACKEND_ADDRESS_FAMILY
,
required_argument
,
&
flag
,
116
},
{
nullptr
,
0
,
nullptr
,
0
}};
int
option_index
=
0
;
...
...
@@ -2949,6 +2944,10 @@ int main(int argc, char **argv) {
cmdcfgs
.
emplace_back
(
SHRPX_OPT_TLS_SESSION_CACHE_MEMCACHED_ADDRESS_FAMILY
,
optarg
);
break
;
case
116
:
// --backend-address-family
cmdcfgs
.
emplace_back
(
SHRPX_OPT_BACKEND_ADDRESS_FAMILY
,
optarg
);
break
;
default:
break
;
}
...
...
src/shrpx_config.cc
View file @
72877379
...
...
@@ -693,6 +693,7 @@ enum {
SHRPX_OPTID_ADD_X_FORWARDED_FOR
,
SHRPX_OPTID_ALTSVC
,
SHRPX_OPTID_BACKEND
,
SHRPX_OPTID_BACKEND_ADDRESS_FAMILY
,
SHRPX_OPTID_BACKEND_HTTP_PROXY_URI
,
SHRPX_OPTID_BACKEND_HTTP1_CONNECTIONS_PER_FRONTEND
,
SHRPX_OPTID_BACKEND_HTTP1_CONNECTIONS_PER_HOST
,
...
...
@@ -1232,6 +1233,11 @@ int option_lookup_token(const char *name, size_t namelen) {
return
SHRPX_OPTID_FRONTEND_WRITE_TIMEOUT
;
}
break
;
case
'y'
:
if
(
util
::
strieq_l
(
"backend-address-famil"
,
name
,
21
))
{
return
SHRPX_OPTID_BACKEND_ADDRESS_FAMILY
;
}
break
;
}
break
;
case
23
:
...
...
@@ -1854,11 +1860,17 @@ int parse_config(const char *opt, const char *optarg,
return
0
;
case
SHRPX_OPTID_BACKEND_IPV4
:
mod_config
()
->
conn
.
downstream
.
ipv4
=
util
::
strieq
(
optarg
,
"yes"
);
LOG
(
WARN
)
<<
opt
<<
": deprecated. Use backend-address-family=IPv4 instead."
;
mod_config
()
->
conn
.
downstream
.
family
=
AF_INET
;
return
0
;
case
SHRPX_OPTID_BACKEND_IPV6
:
mod_config
()
->
conn
.
downstream
.
ipv6
=
util
::
strieq
(
optarg
,
"yes"
);
LOG
(
WARN
)
<<
opt
<<
": deprecated. Use backend-address-family=IPv6 instead."
;
mod_config
()
->
conn
.
downstream
.
family
=
AF_INET6
;
return
0
;
case
SHRPX_OPTID_BACKEND_HTTP_PROXY_URI
:
{
...
...
@@ -2348,6 +2360,9 @@ int parse_config(const char *opt, const char *optarg,
case
SHRPX_OPTID_TLS_SESSION_CACHE_MEMCACHED_ADDRESS_FAMILY
:
return
parse_address_family
(
&
mod_config
()
->
tls
.
session_cache
.
memcached
.
family
,
opt
,
optarg
);
case
SHRPX_OPTID_BACKEND_ADDRESS_FAMILY
:
return
parse_address_family
(
&
mod_config
()
->
conn
.
downstream
.
family
,
opt
,
optarg
);
case
SHRPX_OPTID_CONF
:
LOG
(
WARN
)
<<
"conf: ignored"
;
...
...
src/shrpx_config.h
View file @
72877379
...
...
@@ -225,6 +225,7 @@ constexpr char SHRPX_OPT_TLS_TICKET_KEY_MEMCACHED_PRIVATE_KEY_FILE[] =
"tls-ticket-key-memcached-private-key-file"
;
constexpr
char
SHRPX_OPT_TLS_TICKET_KEY_MEMCACHED_ADDRESS_FAMILY
[]
=
"tls-ticket-key-memcached-address-family"
;
constexpr
char
SHRPX_OPT_BACKEND_ADDRESS_FAMILY
[]
=
"backend-address-family"
;
constexpr
size_t
SHRPX_OBFUSCATED_NODE_LENGTH
=
8
;
...
...
@@ -567,13 +568,12 @@ struct ConnectionConfig {
size_t
response_buffer_size
;
// downstream protocol; this will be determined by given options.
shrpx_proto
proto
;
// Address family of backend connection. One of either AF_INET,
// AF_INET6 or AF_UNSPEC. This is ignored if backend connection
// is made via Unix domain socket.
int
family
;
bool
no_tls
;
bool
http1_tls
;
// true if IPv4 only; ipv4 and ipv6 are mutually exclusive; and
// (ipv4 && ipv6) must be false.
bool
ipv4
;
// true if IPv6 only
bool
ipv6
;
}
downstream
;
}
;
...
...
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