diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2019-10-17 01:54:27 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2020-05-23 17:59:29 -0400 |
commit | 2c43ae73dd8e8c475fcd578d4bcdf6fccfadb59c (patch) | |
tree | d0da6761c9172bcb2f3aeea2f1652b08703db35a /src/mod_redirect.c | |
parent | 36f64b26a11500ac720dad148481a1a0e66a8ba7 (diff) | |
download | lighttpd-git-2c43ae73dd8e8c475fcd578d4bcdf6fccfadb59c.tar.gz |
[mod_redirect,mod_rewrite] store context_ndx
store config context_ndx instead of data_config *dc
Diffstat (limited to 'src/mod_redirect.c')
-rw-r--r-- | src/mod_redirect.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mod_redirect.c b/src/mod_redirect.c index 698dcbe8..90a5ddac 100644 --- a/src/mod_redirect.c +++ b/src/mod_redirect.c @@ -14,7 +14,7 @@ typedef struct { pcre_keyvalue_buffer *redirect; - data_config *context; /* to which apply me */ + int context_ndx; /* to which apply me */ unsigned short redirect_code; } plugin_config; @@ -120,7 +120,7 @@ static int mod_redirect_patch_connection(server *srv, connection *con, plugin_da p->conf.redirect = s->redirect; p->conf.redirect_code = s->redirect_code; - p->conf.context = NULL; + p->conf.context_ndx = 0; /* skip the first, the global context */ for (i = 1; i < srv->config_context->used; i++) { @@ -135,7 +135,7 @@ static int mod_redirect_patch_connection(server *srv, connection *con, plugin_da if (0 == strcmp(du->key.ptr, "url.redirect")) { p->conf.redirect = s->redirect; - p->conf.context = dc; + p->conf.context_ndx = i; } else if (0 == strcmp(du->key.ptr, "url.redirect-code")) { p->conf.redirect_code = s->redirect_code; } @@ -153,8 +153,8 @@ URIHANDLER_FUNC(mod_redirect_uri_handler) { mod_redirect_patch_connection(srv, con, p); if (!p->conf.redirect->used) return HANDLER_GO_ON; - ctx.cache = p->conf.context - ? &con->cond_cache[p->conf.context->context_ndx] + ctx.cache = p->conf.context_ndx + ? &con->cond_cache[p->conf.context_ndx] : NULL; ctx.burl = &burl; burl.scheme = con->uri.scheme; |