Mercurial > hg > nginx
comparison src/mail/ngx_mail_core_module.c @ 2798:268d8d3faa34
axe imap module artifacts
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 04 May 2009 19:34:59 +0000 |
parents | 2e91aecb9e57 |
children | a96a8c916b0c |
comparison
equal
deleted
inserted
replaced
2797:90422d071d3f | 2798:268d8d3faa34 |
---|---|
282 ngx_mail_core_srv_conf_t *cscf = conf; | 282 ngx_mail_core_srv_conf_t *cscf = conf; |
283 | 283 |
284 ngx_str_t *value; | 284 ngx_str_t *value; |
285 ngx_url_t u; | 285 ngx_url_t u; |
286 ngx_uint_t i, m; | 286 ngx_uint_t i, m; |
287 ngx_mail_listen_t *imls; | 287 ngx_mail_listen_t *ls; |
288 ngx_mail_module_t *module; | 288 ngx_mail_module_t *module; |
289 ngx_mail_core_main_conf_t *cmcf; | 289 ngx_mail_core_main_conf_t *cmcf; |
290 | 290 |
291 value = cf->args->elts; | 291 value = cf->args->elts; |
292 | 292 |
310 return NGX_CONF_ERROR; | 310 return NGX_CONF_ERROR; |
311 } | 311 } |
312 | 312 |
313 cmcf = ngx_mail_conf_get_module_main_conf(cf, ngx_mail_core_module); | 313 cmcf = ngx_mail_conf_get_module_main_conf(cf, ngx_mail_core_module); |
314 | 314 |
315 imls = cmcf->listen.elts; | 315 ls = cmcf->listen.elts; |
316 | 316 |
317 for (i = 0; i < cmcf->listen.nelts; i++) { | 317 for (i = 0; i < cmcf->listen.nelts; i++) { |
318 | 318 |
319 if (imls[i].addr != u.addr.in_addr || imls[i].port != u.port) { | 319 if (ls[i].addr != u.addr.in_addr || ls[i].port != u.port) { |
320 continue; | 320 continue; |
321 } | 321 } |
322 | 322 |
323 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 323 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
324 "duplicate \"%V\" address and port pair", &u.url); | 324 "duplicate \"%V\" address and port pair", &u.url); |
325 return NGX_CONF_ERROR; | 325 return NGX_CONF_ERROR; |
326 } | 326 } |
327 | 327 |
328 imls = ngx_array_push(&cmcf->listen); | 328 ls = ngx_array_push(&cmcf->listen); |
329 if (imls == NULL) { | 329 if (ls == NULL) { |
330 return NGX_CONF_ERROR; | 330 return NGX_CONF_ERROR; |
331 } | 331 } |
332 | 332 |
333 ngx_memzero(imls, sizeof(ngx_mail_listen_t)); | 333 ngx_memzero(ls, sizeof(ngx_mail_listen_t)); |
334 | 334 |
335 imls->addr = u.addr.in_addr; | 335 ls->addr = u.addr.in_addr; |
336 imls->port = u.port; | 336 ls->port = u.port; |
337 imls->family = u.family; | 337 ls->family = u.family; |
338 imls->ctx = cf->ctx; | 338 ls->ctx = cf->ctx; |
339 | 339 |
340 for (m = 0; ngx_modules[m]; m++) { | 340 for (m = 0; ngx_modules[m]; m++) { |
341 if (ngx_modules[m]->type != NGX_MAIL_MODULE) { | 341 if (ngx_modules[m]->type != NGX_MAIL_MODULE) { |
342 continue; | 342 continue; |
343 } | 343 } |
357 } | 357 } |
358 | 358 |
359 for (i = 2; i < cf->args->nelts; i++) { | 359 for (i = 2; i < cf->args->nelts; i++) { |
360 | 360 |
361 if (ngx_strcmp(value[i].data, "bind") == 0) { | 361 if (ngx_strcmp(value[i].data, "bind") == 0) { |
362 imls->bind = 1; | 362 ls->bind = 1; |
363 continue; | 363 continue; |
364 } | 364 } |
365 | 365 |
366 if (ngx_strcmp(value[i].data, "ssl") == 0) { | 366 if (ngx_strcmp(value[i].data, "ssl") == 0) { |
367 #if (NGX_MAIL_SSL) | 367 #if (NGX_MAIL_SSL) |
368 imls->ssl = 1; | 368 ls->ssl = 1; |
369 continue; | 369 continue; |
370 #else | 370 #else |
371 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 371 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
372 "the \"ssl\" parameter requires " | 372 "the \"ssl\" parameter requires " |
373 "ngx_mail_ssl_module"); | 373 "ngx_mail_ssl_module"); |