Mercurial > hg > nginx
comparison src/mail/ngx_mail_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 | 2a621245f4cf |
children | 6f8254ae61b8 |
comparison
equal
deleted
inserted
replaced
6378:0f203a2af17c | 6379:cf5e822cf470 |
---|---|
235 ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_mail_max_module); | 235 ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_mail_max_module); |
236 if (ctx->srv_conf == NULL) { | 236 if (ctx->srv_conf == NULL) { |
237 return NGX_CONF_ERROR; | 237 return NGX_CONF_ERROR; |
238 } | 238 } |
239 | 239 |
240 for (m = 0; ngx_modules[m]; m++) { | 240 for (m = 0; cf->cycle->modules[m]; m++) { |
241 if (ngx_modules[m]->type != NGX_MAIL_MODULE) { | 241 if (cf->cycle->modules[m]->type != NGX_MAIL_MODULE) { |
242 continue; | 242 continue; |
243 } | 243 } |
244 | 244 |
245 module = ngx_modules[m]->ctx; | 245 module = cf->cycle->modules[m]->ctx; |
246 | 246 |
247 if (module->create_srv_conf) { | 247 if (module->create_srv_conf) { |
248 mconf = module->create_srv_conf(cf); | 248 mconf = module->create_srv_conf(cf); |
249 if (mconf == NULL) { | 249 if (mconf == NULL) { |
250 return NGX_CONF_ERROR; | 250 return NGX_CONF_ERROR; |
251 } | 251 } |
252 | 252 |
253 ctx->srv_conf[ngx_modules[m]->ctx_index] = mconf; | 253 ctx->srv_conf[cf->cycle->modules[m]->ctx_index] = mconf; |
254 } | 254 } |
255 } | 255 } |
256 | 256 |
257 /* the server configuration context */ | 257 /* the server configuration context */ |
258 | 258 |
390 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) | 390 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) |
391 ls->ipv6only = 1; | 391 ls->ipv6only = 1; |
392 #endif | 392 #endif |
393 | 393 |
394 if (cscf->protocol == NULL) { | 394 if (cscf->protocol == NULL) { |
395 for (m = 0; ngx_modules[m]; m++) { | 395 for (m = 0; cf->cycle->modules[m]; m++) { |
396 if (ngx_modules[m]->type != NGX_MAIL_MODULE) { | 396 if (cf->cycle->modules[m]->type != NGX_MAIL_MODULE) { |
397 continue; | 397 continue; |
398 } | 398 } |
399 | 399 |
400 module = ngx_modules[m]->ctx; | 400 module = cf->cycle->modules[m]->ctx; |
401 | 401 |
402 if (module->protocol == NULL) { | 402 if (module->protocol == NULL) { |
403 continue; | 403 continue; |
404 } | 404 } |
405 | 405 |
593 ngx_uint_t m; | 593 ngx_uint_t m; |
594 ngx_mail_module_t *module; | 594 ngx_mail_module_t *module; |
595 | 595 |
596 value = cf->args->elts; | 596 value = cf->args->elts; |
597 | 597 |
598 for (m = 0; ngx_modules[m]; m++) { | 598 for (m = 0; cf->cycle->modules[m]; m++) { |
599 if (ngx_modules[m]->type != NGX_MAIL_MODULE) { | 599 if (cf->cycle->modules[m]->type != NGX_MAIL_MODULE) { |
600 continue; | 600 continue; |
601 } | 601 } |
602 | 602 |
603 module = ngx_modules[m]->ctx; | 603 module = cf->cycle->modules[m]->ctx; |
604 | 604 |
605 if (module->protocol | 605 if (module->protocol |
606 && ngx_strcmp(module->protocol->name.data, value[1].data) == 0) | 606 && ngx_strcmp(module->protocol->name.data, value[1].data) == 0) |
607 { | 607 { |
608 cscf->protocol = module->protocol; | 608 cscf->protocol = module->protocol; |