nghttpx: Enforce the fact that api and healthmon are mutually exclusive
This commit is contained in:
parent
4aa79763be
commit
e2bdf1d734
|
@ -1354,7 +1354,8 @@ Connections:
|
||||||
multiple addresses.
|
multiple addresses.
|
||||||
|
|
||||||
This option can take 0 or more parameters, which are
|
This option can take 0 or more parameters, which are
|
||||||
described below.
|
described below. Note that "api" and "healthmon"
|
||||||
|
parameters are mutually exclusive.
|
||||||
|
|
||||||
Optionally, TLS can be disabled by specifying "no-tls"
|
Optionally, TLS can be disabled by specifying "no-tls"
|
||||||
parameter. TLS is enabled by default.
|
parameter. TLS is enabled by default.
|
||||||
|
|
|
@ -629,8 +629,16 @@ int parse_upstream_params(UpstreamParams &out, const StringRef &src_params) {
|
||||||
} else if (util::strieq_l("no-tls", param)) {
|
} else if (util::strieq_l("no-tls", param)) {
|
||||||
out.tls = false;
|
out.tls = false;
|
||||||
} else if (util::strieq_l("api", param)) {
|
} else if (util::strieq_l("api", param)) {
|
||||||
|
if (out.alt_mode && out.alt_mode != ALTMODE_API) {
|
||||||
|
LOG(ERROR) << "frontend: api and healthmon are mutually exclusive";
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
out.alt_mode = ALTMODE_API;
|
out.alt_mode = ALTMODE_API;
|
||||||
} else if (util::strieq_l("healthmon", param)) {
|
} else if (util::strieq_l("healthmon", param)) {
|
||||||
|
if (out.alt_mode && out.alt_mode != ALTMODE_HEALTHMON) {
|
||||||
|
LOG(ERROR) << "frontend: api and healthmon are mutually exclusive";
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
out.alt_mode = ALTMODE_HEALTHMON;
|
out.alt_mode = ALTMODE_HEALTHMON;
|
||||||
} else if (!param.empty()) {
|
} else if (!param.empty()) {
|
||||||
LOG(ERROR) << "frontend: " << param << ": unknown keyword";
|
LOG(ERROR) << "frontend: " << param << ": unknown keyword";
|
||||||
|
|
Loading…
Reference in New Issue