summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/http/ngx_http.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 64af44760..05bc48b0f 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -144,14 +144,7 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
/* 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 */