diff src/stream/ngx_stream.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 78c06e5e1d76
children cf5e822cf470
line wrap: on
line diff
--- a/src/stream/ngx_stream.c
+++ b/src/stream/ngx_stream.c
@@ -91,14 +91,7 @@ ngx_stream_block(ngx_conf_t *cf, ngx_com
 
     /* count the number of the stream modules and set up their indices */
 
-    ngx_stream_max_module = 0;
-    for (m = 0; ngx_modules[m]; m++) {
-        if (ngx_modules[m]->type != NGX_STREAM_MODULE) {
-            continue;
-        }
-
-        ngx_modules[m]->ctx_index = ngx_stream_max_module++;
-    }
+    ngx_stream_max_module = ngx_count_modules(cf->cycle, NGX_STREAM_MODULE);
 
 
     /* the stream main_conf context, it's the same in the all stream contexts */