diff src/http/ngx_http_core_module.c @ 6379:cf5e822cf470

Dynamic modules: changed ngx_modules to cycle->modules.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 04 Feb 2016 18:30:21 +0300
parents fcbac620ae83
children cf3e75cfa951
line wrap: on
line diff
--- 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
         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
                 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
                 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, n
         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 *c
         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 *c
                  return NGX_CONF_ERROR;
             }
 
-            ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf;
+            ctx->loc_conf[cf->cycle->modules[i]->ctx_index] = mconf;
         }
     }