summaryrefslogtreecommitdiff
path: root/src/mod_vhostdb_ldap.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-10-17 01:27:52 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2020-05-23 17:59:29 -0400
commit36f64b26a11500ac720dad148481a1a0e66a8ba7 (patch)
treec978431d0ddffe72cb9888cf7eda83dab48607d0 /src/mod_vhostdb_ldap.c
parentb6e0880ae6a92991a13d3297bbf2e2ac5159e6b6 (diff)
downloadlighttpd-git-36f64b26a11500ac720dad148481a1a0e66a8ba7.tar.gz
[core] simpler config_check_cond()
optimize for common case where condition has been evaluated for the request and a cached result exists (also: begin isolating data_config)
Diffstat (limited to 'src/mod_vhostdb_ldap.c')
-rw-r--r--src/mod_vhostdb_ldap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mod_vhostdb_ldap.c b/src/mod_vhostdb_ldap.c
index e2f55af8..e8eea3ec 100644
--- a/src/mod_vhostdb_ldap.c
+++ b/src/mod_vhostdb_ldap.c
@@ -526,12 +526,11 @@ static void mod_vhostdb_patch_connection (server *srv, connection *con, plugin_d
/* skip the first, the global context */
for (size_t i = 1; i < srv->config_context->used; ++i) {
+ if (!config_check_cond(con, i)) continue; /* condition not matched */
+
data_config *dc = (data_config *)srv->config_context->data[i];
s = p->config_storage[i];
- /* condition didn't match */
- if (!config_check_cond(srv, con, dc)) continue;
-
/* merge config */
for (size_t j = 0; j < dc->value->used; ++j) {
data_unset *du = dc->value->data[j];