diff src/mail/ngx_mail.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/mail/ngx_mail.c
+++ b/src/mail/ngx_mail.c
@@ -91,14 +91,7 @@ ngx_mail_block(ngx_conf_t *cf, ngx_comma
 
     /* count the number of the mail modules and set up their indices */
 
-    ngx_mail_max_module = 0;
-    for (m = 0; ngx_modules[m]; m++) {
-        if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
-            continue;
-        }
-
-        ngx_modules[m]->ctx_index = ngx_mail_max_module++;
-    }
+    ngx_mail_max_module = ngx_count_modules(cf->cycle, NGX_MAIL_MODULE);
 
 
     /* the mail main_conf context, it is the same in the all mail contexts */