summaryrefslogtreecommitdiffhomepage
path: root/src/http
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2016-02-04 18:30:21 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2016-02-04 18:30:21 +0300
commit0f67d6355cb365983820d3c268e25424509b2ef6 (patch)
tree5131f107ccec87cd7df68815da5220d106527070 /src/http
parent798833457018ee8a6274ec78e816f747361c0d47 (diff)
downloadnginx-0f67d6355cb365983820d3c268e25424509b2ef6.tar.gz
nginx-0f67d6355cb365983820d3c268e25424509b2ef6.tar.bz2
Dynamic modules: changed ngx_modules to cycle->modules.
Diffstat (limited to 'src/http')
-rw-r--r--src/http/modules/ngx_http_rewrite_module.c8
-rw-r--r--src/http/ngx_http.c28
-rw-r--r--src/http/ngx_http_core_module.c28
-rw-r--r--src/http/ngx_http_upstream.c10
4 files changed, 37 insertions, 37 deletions
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c
index 754512fb1..2ec7f5d10 100644
--- a/src/http/modules/ngx_http_rewrite_module.c
+++ b/src/http/modules/ngx_http_rewrite_module.c
@@ -560,12 +560,12 @@ ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_HTTP_MODULE) {
+ for (i = 0; cf->cycle->modules[i]; i++) {
+ if (cf->cycle->modules[i]->type != NGX_HTTP_MODULE) {
continue;
}
- module = ngx_modules[i]->ctx;
+ module = cf->cycle->modules[i]->ctx;
if (module->create_loc_conf) {
@@ -574,7 +574,7 @@ ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf;
+ ctx->loc_conf[cf->cycle->modules[i]->ctx_index] = mconf;
}
}
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 05bc48b0f..0ceb613d6 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -183,13 +183,13 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
* of the all http modules
*/
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
+ for (m = 0; cf->cycle->modules[m]; m++) {
+ if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {
continue;
}
- module = ngx_modules[m]->ctx;
- mi = ngx_modules[m]->ctx_index;
+ module = cf->cycle->modules[m]->ctx;
+ mi = cf->cycle->modules[m]->ctx_index;
if (module->create_main_conf) {
ctx->main_conf[mi] = module->create_main_conf(cf);
@@ -216,12 +216,12 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
pcf = *cf;
cf->ctx = ctx;
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
+ for (m = 0; cf->cycle->modules[m]; m++) {
+ if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {
continue;
}
- module = ngx_modules[m]->ctx;
+ module = cf->cycle->modules[m]->ctx;
if (module->preconfiguration) {
if (module->preconfiguration(cf) != NGX_OK) {
@@ -248,13 +248,13 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
cmcf = ctx->main_conf[ngx_http_core_module.ctx_index];
cscfp = cmcf->servers.elts;
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
+ for (m = 0; cf->cycle->modules[m]; m++) {
+ if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {
continue;
}
- module = ngx_modules[m]->ctx;
- mi = ngx_modules[m]->ctx_index;
+ module = cf->cycle->modules[m]->ctx;
+ mi = cf->cycle->modules[m]->ctx_index;
/* init http{} main_conf's */
@@ -297,12 +297,12 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
+ for (m = 0; cf->cycle->modules[m]; m++) {
+ if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {
continue;
}
- module = ngx_modules[m]->ctx;
+ module = cf->cycle->modules[m]->ctx;
if (module->postconfiguration) {
if (module->postconfiguration(cf) != NGX_OK) {
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 4b8dd4c90..df7e8d4c1 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -2968,12 +2968,12 @@ ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
return NGX_CONF_ERROR;
}
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_HTTP_MODULE) {
+ for (i = 0; cf->cycle->modules[i]; i++) {
+ if (cf->cycle->modules[i]->type != NGX_HTTP_MODULE) {
continue;
}
- module = ngx_modules[i]->ctx;
+ module = cf->cycle->modules[i]->ctx;
if (module->create_srv_conf) {
mconf = module->create_srv_conf(cf);
@@ -2981,7 +2981,7 @@ ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
return NGX_CONF_ERROR;
}
- ctx->srv_conf[ngx_modules[i]->ctx_index] = mconf;
+ ctx->srv_conf[cf->cycle->modules[i]->ctx_index] = mconf;
}
if (module->create_loc_conf) {
@@ -2990,7 +2990,7 @@ ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
return NGX_CONF_ERROR;
}
- ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf;
+ ctx->loc_conf[cf->cycle->modules[i]->ctx_index] = mconf;
}
}
@@ -3086,17 +3086,17 @@ ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
return NGX_CONF_ERROR;
}
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_HTTP_MODULE) {
+ for (i = 0; cf->cycle->modules[i]; i++) {
+ if (cf->cycle->modules[i]->type != NGX_HTTP_MODULE) {
continue;
}
- module = ngx_modules[i]->ctx;
+ module = cf->cycle->modules[i]->ctx;
if (module->create_loc_conf) {
- ctx->loc_conf[ngx_modules[i]->ctx_index] =
+ ctx->loc_conf[cf->cycle->modules[i]->ctx_index] =
module->create_loc_conf(cf);
- if (ctx->loc_conf[ngx_modules[i]->ctx_index] == NULL) {
+ if (ctx->loc_conf[cf->cycle->modules[i]->ctx_index] == NULL) {
return NGX_CONF_ERROR;
}
}
@@ -4607,12 +4607,12 @@ ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_HTTP_MODULE) {
+ for (i = 0; cf->cycle->modules[i]; i++) {
+ if (cf->cycle->modules[i]->type != NGX_HTTP_MODULE) {
continue;
}
- module = ngx_modules[i]->ctx;
+ module = cf->cycle->modules[i]->ctx;
if (module->create_loc_conf) {
@@ -4621,7 +4621,7 @@ ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
- ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf;
+ ctx->loc_conf[cf->cycle->modules[i]->ctx_index] = mconf;
}
}
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 7f377b676..dbaa9563d 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -5331,12 +5331,12 @@ ngx_http_upstream(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
return NGX_CONF_ERROR;
}
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
+ for (m = 0; cf->cycle->modules[m]; m++) {
+ if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {
continue;
}
- module = ngx_modules[m]->ctx;
+ module = cf->cycle->modules[m]->ctx;
if (module->create_srv_conf) {
mconf = module->create_srv_conf(cf);
@@ -5344,7 +5344,7 @@ ngx_http_upstream(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
return NGX_CONF_ERROR;
}
- ctx->srv_conf[ngx_modules[m]->ctx_index] = mconf;
+ ctx->srv_conf[cf->cycle->modules[m]->ctx_index] = mconf;
}
if (module->create_loc_conf) {
@@ -5353,7 +5353,7 @@ ngx_http_upstream(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
return NGX_CONF_ERROR;
}
- ctx->loc_conf[ngx_modules[m]->ctx_index] = mconf;
+ ctx->loc_conf[cf->cycle->modules[m]->ctx_index] = mconf;
}
}