Mercurial > hg > nginx
comparison src/mail/ngx_mail.c @ 6130:fc99323a3d79
Mail: error_log support.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Fri, 20 Feb 2015 15:31:37 +0300 |
parents | eb4ba3800c31 |
children | 53bccdc4923a |
comparison
equal
deleted
inserted
replaced
6129:187aa751ad62 | 6130:fc99323a3d79 |
---|---|
332 | 332 |
333 | 333 |
334 static char * | 334 static char * |
335 ngx_mail_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports) | 335 ngx_mail_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports) |
336 { | 336 { |
337 ngx_uint_t i, p, last, bind_wildcard; | 337 ngx_uint_t i, p, last, bind_wildcard; |
338 ngx_listening_t *ls; | 338 ngx_listening_t *ls; |
339 ngx_mail_port_t *mport; | 339 ngx_mail_port_t *mport; |
340 ngx_mail_conf_port_t *port; | 340 ngx_mail_conf_port_t *port; |
341 ngx_mail_conf_addr_t *addr; | 341 ngx_mail_conf_addr_t *addr; |
342 ngx_mail_core_srv_conf_t *cscf; | |
342 | 343 |
343 port = ports->elts; | 344 port = ports->elts; |
344 for (p = 0; p < ports->nelts; p++) { | 345 for (p = 0; p < ports->nelts; p++) { |
345 | 346 |
346 ngx_sort(port[p].addrs.elts, (size_t) port[p].addrs.nelts, | 347 ngx_sort(port[p].addrs.elts, (size_t) port[p].addrs.nelts, |
378 | 379 |
379 ls->addr_ntop = 1; | 380 ls->addr_ntop = 1; |
380 ls->handler = ngx_mail_init_connection; | 381 ls->handler = ngx_mail_init_connection; |
381 ls->pool_size = 256; | 382 ls->pool_size = 256; |
382 | 383 |
383 /* TODO: error_log directive */ | 384 cscf = addr->ctx->srv_conf[ngx_mail_core_module.ctx_index]; |
384 ls->logp = &cf->cycle->new_log; | 385 |
386 ls->logp = cscf->error_log; | |
385 ls->log.data = &ls->addr_text; | 387 ls->log.data = &ls->addr_text; |
386 ls->log.handler = ngx_accept_log_error; | 388 ls->log.handler = ngx_accept_log_error; |
387 | 389 |
388 ls->keepalive = addr[i].so_keepalive; | 390 ls->keepalive = addr[i].so_keepalive; |
389 #if (NGX_HAVE_KEEPALIVE_TUNABLE) | 391 #if (NGX_HAVE_KEEPALIVE_TUNABLE) |