diff src/http/ngx_http.c @ 6378:0f203a2af17c

Dynamic modules: moved module-related stuff to separate files.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 04 Feb 2016 18:30:21 +0300
parents ceeb1edb3018
children cf5e822cf470
line wrap: on
line diff
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -144,14 +144,7 @@ ngx_http_block(ngx_conf_t *cf, ngx_comma
 
     /* count the number of the http modules and set up their indices */
 
-    ngx_http_max_module = 0;
-    for (m = 0; ngx_modules[m]; m++) {
-        if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
-            continue;
-        }
-
-        ngx_modules[m]->ctx_index = ngx_http_max_module++;
-    }
+    ngx_http_max_module = ngx_count_modules(cf->cycle, NGX_HTTP_MODULE);
 
 
     /* the http main_conf context, it is the same in the all http contexts */