diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2007-09-14 10:42:19 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2007-09-14 10:42:19 +0000 |
| commit | 706ab65f5413ab77f8915e870981fbe0b0a47235 (patch) | |
| tree | 260b9fa329f381dd0d6c57972f8d6c30cc0ae190 /src/mail/ngx_mail_smtp_handler.c | |
| parent | 5fbe12146e84860a1e7cea077b1b2c705bacfed1 (diff) | |
| download | nginx-706ab65f5413ab77f8915e870981fbe0b0a47235.tar.gz nginx-706ab65f5413ab77f8915e870981fbe0b0a47235.tar.bz2 | |
move event handling to protocol specific code,
it is required to support SMTP greeting delay
Diffstat (limited to 'src/mail/ngx_mail_smtp_handler.c')
| -rw-r--r-- | src/mail/ngx_mail_smtp_handler.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mail/ngx_mail_smtp_handler.c b/src/mail/ngx_mail_smtp_handler.c index 76637f92f..92be7fa83 100644 --- a/src/mail/ngx_mail_smtp_handler.c +++ b/src/mail/ngx_mail_smtp_handler.c @@ -41,9 +41,15 @@ ngx_mail_smtp_init_session(ngx_mail_session_t *s, ngx_connection_t *c) } } + 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); } |
