Mercurial > hg > nginx
diff src/mail/ngx_mail_smtp_handler.c @ 1480:a231e37a19ab
move event handling to protocol specific code,
it is required to support SMTP greeting delay
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 14 Sep 2007 10:42:19 +0000 |
parents | 2647950e047f |
children | b58ce1cf66da |
line wrap: on
line diff
--- a/src/mail/ngx_mail_smtp_handler.c Thu Sep 13 21:24:27 2007 +0000 +++ b/src/mail/ngx_mail_smtp_handler.c Fri Sep 14 10:42:19 2007 +0000 @@ -41,9 +41,15 @@ } } + s->out = cscf->smtp_greeting; + c->read->handler = ngx_mail_smtp_init_protocol; - s->out = cscf->smtp_greeting; + ngx_add_timer(c->read, cscf->timeout); + + if (ngx_handle_read_event(c->read, 0) == NGX_ERROR) { + ngx_mail_close_connection(c); + } ngx_mail_send(c->write); }