summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conf_validation.c
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2018-02-06 20:31:48 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2018-02-06 20:31:48 +0300
commitb4e467e669fc35a92e371280e4068653db53c1b5 (patch)
tree9b14f9062e3e68b660b5975b2424cc148864f647 /src/nxt_conf_validation.c
parent5c35d30cc8527abee446ea8d131afa2973e43482 (diff)
downloadunit-b4e467e669fc35a92e371280e4068653db53c1b5.tar.gz
unit-b4e467e669fc35a92e371280e4068653db53c1b5.tar.bz2
Fixed configuration checks for "max" property.
Diffstat (limited to '')
-rw-r--r--src/nxt_conf_validation.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/nxt_conf_validation.c b/src/nxt_conf_validation.c
index 33e739ea..ea160d8e 100644
--- a/src/nxt_conf_validation.c
+++ b/src/nxt_conf_validation.c
@@ -544,8 +544,6 @@ nxt_conf_vldt_processes(nxt_conf_validation_t *vldt, nxt_conf_value_t *value,
nxt_int_t ret;
nxt_conf_vldt_processes_conf_t proc;
- static nxt_str_t max_str = nxt_string("max");
-
if (nxt_conf_type(value) == NXT_CONF_INTEGER) {
int_value = nxt_conf_get_integer(value);
@@ -589,22 +587,19 @@ nxt_conf_vldt_processes(nxt_conf_validation_t *vldt, nxt_conf_value_t *value,
"not exceed %d.", NXT_INT32_T_MAX);
}
- if (nxt_conf_get_object_member(value, &max_str, NULL) != NULL) {
-
- if (proc.max < 1) {
- return nxt_conf_vldt_error(vldt, "The \"max\" number must be equal "
- "to or greater than 1.");
- }
+ if (proc.max < 1) {
+ return nxt_conf_vldt_error(vldt, "The \"max\" number must be equal "
+ "to or greater than 1.");
+ }
- if (proc.max > NXT_INT32_T_MAX) {
- return nxt_conf_vldt_error(vldt, "The \"max\" number must not "
- "not exceed %d.", NXT_INT32_T_MAX);
- }
+ if (proc.max > NXT_INT32_T_MAX) {
+ return nxt_conf_vldt_error(vldt, "The \"max\" number must not "
+ "not exceed %d.", NXT_INT32_T_MAX);
+ }
- if (proc.max < proc.spare) {
- return nxt_conf_vldt_error(vldt, "The \"spare\" number must be "
- "lower than \"max\".");
- }
+ if (proc.max < proc.spare) {
+ return nxt_conf_vldt_error(vldt, "The \"spare\" number must be "
+ "lower than \"max\".");
}
if (proc.idle_timeout < 0) {