summaryrefslogtreecommitdiffhomepage
path: root/src/mail/ngx_mail_pop3_handler.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-09-14 10:42:19 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-09-14 10:42:19 +0000
commit706ab65f5413ab77f8915e870981fbe0b0a47235 (patch)
tree260b9fa329f381dd0d6c57972f8d6c30cc0ae190 /src/mail/ngx_mail_pop3_handler.c
parent5fbe12146e84860a1e7cea077b1b2c705bacfed1 (diff)
downloadnginx-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_pop3_handler.c')
-rw-r--r--src/mail/ngx_mail_pop3_handler.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mail/ngx_mail_pop3_handler.c b/src/mail/ngx_mail_pop3_handler.c
index 708787128..31cbc2192 100644
--- a/src/mail/ngx_mail_pop3_handler.c
+++ b/src/mail/ngx_mail_pop3_handler.c
@@ -62,6 +62,12 @@ ngx_mail_pop3_init_session(ngx_mail_session_t *s, ngx_connection_t *c)
c->read->handler = ngx_mail_pop3_init_protocol;
+ 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);
}