diff options
author | Zhidao HONG <z.hong@f5.com> | 2022-07-14 04:32:49 +0800 |
---|---|---|
committer | Zhidao HONG <z.hong@f5.com> | 2022-07-14 04:32:49 +0800 |
commit | 45b89e32577eef18e473d0c7ae24562e7efedcc0 (patch) | |
tree | d7058ec9ad0fb257897873cc1429182425d17b9b /src/nxt_conf_validation.c | |
parent | 7b80186f097fda3d1c0758a30efa889ec89c5a9d (diff) | |
download | unit-45b89e32577eef18e473d0c7ae24562e7efedcc0.tar.gz unit-45b89e32577eef18e473d0c7ae24562e7efedcc0.tar.bz2 |
Var: dynamic variables support.
This commit adds the variables $arg_NAME, $header_NAME, and $cookie_NAME.
Diffstat (limited to 'src/nxt_conf_validation.c')
-rw-r--r-- | src/nxt_conf_validation.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nxt_conf_validation.c b/src/nxt_conf_validation.c index a5958788..47164e92 100644 --- a/src/nxt_conf_validation.c +++ b/src/nxt_conf_validation.c @@ -1210,6 +1210,11 @@ nxt_conf_validate(nxt_conf_validation_t *vldt) { nxt_int_t ret; + vldt->var_fields = nxt_array_create(vldt->pool, 4, sizeof(nxt_var_field_t)); + if (nxt_slow_path(vldt->var_fields == NULL)) { + return NXT_ERROR; + } + ret = nxt_conf_vldt_type(vldt, NULL, vldt->conf, NXT_CONF_VLDT_OBJECT); if (ret != NXT_OK) { return ret; @@ -1342,7 +1347,7 @@ nxt_conf_vldt_var(nxt_conf_validation_t *vldt, nxt_str_t *name, { u_char error[NXT_MAX_ERROR_STR]; - if (nxt_var_test(value, error) != NXT_OK) { + if (nxt_var_test(value, vldt->var_fields, error) != NXT_OK) { return nxt_conf_vldt_error(vldt, "%s in the \"%V\" value.", error, name); } |