summaryrefslogtreecommitdiff
path: root/src/mod_staticfile.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_staticfile.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_staticfile.c')
-rw-r--r--src/mod_staticfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mod_staticfile.c b/src/mod_staticfile.c
index 68da1857..3e1e85be 100644
--- a/src/mod_staticfile.c
+++ b/src/mod_staticfile.c
@@ -130,12 +130,11 @@ static int mod_staticfile_patch_connection(server *srv, connection *con, plugin_
/* skip the first, the global context */
for (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 (j = 0; j < dc->value->used; j++) {
data_unset *du = dc->value->data[j];