diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2019-12-07 19:15:55 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2020-07-08 19:54:28 -0400 |
commit | 03b4c993d206221b02cda31e9d25cf2b4bc0813e (patch) | |
tree | 216e0821e67ea43926cad8ceb401a51ae08c9849 /src/mod_staticfile.c | |
parent | 81c9d0acf100d8e89d8d688d29beb1e5bb8d873a (diff) | |
download | lighttpd-git-03b4c993d206221b02cda31e9d25cf2b4bc0813e.tar.gz |
[multiple] generic config array type checking
Diffstat (limited to 'src/mod_staticfile.c')
-rw-r--r-- | src/mod_staticfile.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/mod_staticfile.c b/src/mod_staticfile.c index ede55ee8..d3310525 100644 --- a/src/mod_staticfile.c +++ b/src/mod_staticfile.c @@ -67,7 +67,7 @@ static void mod_staticfile_patch_config(connection * const con, plugin_data * co SETDEFAULTS_FUNC(mod_staticfile_set_defaults) { static const config_plugin_keys_t cpk[] = { { CONST_STR_LEN("static-file.exclude-extensions"), - T_CONFIG_ARRAY, + T_CONFIG_ARRAY_VLIST, T_CONFIG_SCOPE_CONNECTION } ,{ CONST_STR_LEN("static-file.etags"), T_CONFIG_BOOL, @@ -84,26 +84,6 @@ SETDEFAULTS_FUNC(mod_staticfile_set_defaults) { if (!config_plugin_values_init(srv, p, cpk, "mod_staticfile")) return HANDLER_ERROR; - /* process and validate config directives - * (init i to 0 if global context; to 1 to skip empty global context) */ - for (int i = !p->cvlist[0].v.u2[1]; i < p->nconfig; ++i) { - const config_plugin_value_t *cpv = p->cvlist + p->cvlist[i].v.u2[0]; - for (; -1 != cpv->k_id; ++cpv) { - switch (cpv->k_id) { - case 0: /* static-file.exclude-extensions */ - if (!array_is_vlist(cpv->v.a)) { - log_error(srv->errh, __FILE__, __LINE__, - "unexpected value for %s; " - "expected list of \"ext\"", cpk[cpv->k_id].k); - return HANDLER_ERROR; - } - break; - default:/* should not happen */ - break; - } - } - } - /* initialize p->defaults from global config context */ p->defaults.etags_used = 1; /* etags enabled */ if (p->nconfig > 0 && p->cvlist->v.u2[1]) { |