summaryrefslogtreecommitdiff
path: root/src/configfile.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2021-09-22 11:24:06 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2021-09-30 17:34:03 -0400
commit4d99d9b78a769a28c0da68f101e78381063419fd (patch)
tree033e4cd8ef0da478038fe7134c6ec30f6fb218b9 /src/configfile.c
parentf37847b1f6d52eef66e2a775706e5bdecc00e136 (diff)
downloadlighttpd-git-4d99d9b78a769a28c0da68f101e78381063419fd.tar.gz
[multiple] check feature flags funcs; code reuse
config_feature_bool() config_feature_int()
Diffstat (limited to 'src/configfile.c')
-rw-r--r--src/configfile.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/configfile.c b/src/configfile.c
index 84138845..63dd3982 100644
--- a/src/configfile.c
+++ b/src/configfile.c
@@ -246,11 +246,7 @@ static void config_burl_normalize_cond (server * const srv) {
}
static int config_pcre_keyvalue (server * const srv) {
- const int pcre_jit =
- !srv->srvconf.feature_flags
- || config_plugin_value_tobool(
- array_get_element_klen(srv->srvconf.feature_flags,
- CONST_STR_LEN("server.pcre_jit")), 1);
+ const int pcre_jit = config_feature_bool(srv, "server.pcre_jit", 1);
for (uint32_t i = 0; i < srv->config_context->used; ++i) {
data_config * const dc = (data_config *)srv->config_context->data[i];
if (dc->cond != CONFIG_COND_NOMATCH && dc->cond != CONFIG_COND_MATCH)
@@ -1570,13 +1566,8 @@ int config_log_error_open(server *srv) {
}
}
- if (NULL != srv->srvconf.feature_flags) {
- data_unset * const du =
- array_get_data_unset(srv->srvconf.feature_flags,
- CONST_STR_LEN("server.errorlog-high-precision"));
- if (config_plugin_value_tobool(du, 0))
- log_set_global_errh(srv->errh, 1);
- }
+ if (config_feature_bool(srv, "server.errorlog-high-precision", 0))
+ log_set_global_errh(srv->errh, 1);
if (srv->srvconf.errorlog_use_syslog) /*(restricted to global scope)*/
config_log_error_open_syslog(srv, srv->errh,