Klaus Demo nginx / 706ab65
move event handling to protocol specific code, it is required to support SMTP greeting delay Igor Sysoev 14 years ago
4 changed file(s) with 21 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
252252 return;
253253 }
254254
255 ngx_add_timer(c->read, cscf->timeout);
256
257 if (ngx_handle_read_event(c->read, 0) == NGX_ERROR) {
258 ngx_mail_close_connection(c);
259 }
260
261255 c->write->handler = ngx_mail_send;
262256
263257 ngx_mail_init_sessions[s->protocol](s, c);
4444 }
4545 }
4646
47 c->read->handler = ngx_mail_imap_init_protocol;
48
4947 s->out.len = sizeof(imap_greeting) - 1;
5048 s->out.data = imap_greeting;
49
50 c->read->handler = ngx_mail_imap_init_protocol;
51
52 ngx_add_timer(c->read, cscf->timeout);
53
54 if (ngx_handle_read_event(c->read, 0) == NGX_ERROR) {
55 ngx_mail_close_connection(c);
56 }
5157
5258 ngx_mail_send(c->write);
5359 }
6161
6262 c->read->handler = ngx_mail_pop3_init_protocol;
6363
64 ngx_add_timer(c->read, cscf->timeout);
65
66 if (ngx_handle_read_event(c->read, 0) == NGX_ERROR) {
67 ngx_mail_close_connection(c);
68 }
69
6470 ngx_mail_send(c->write);
6571 }
6672
4040 }
4141 }
4242
43 s->out = cscf->smtp_greeting;
44
4345 c->read->handler = ngx_mail_smtp_init_protocol;
4446
45 s->out = cscf->smtp_greeting;
47 ngx_add_timer(c->read, cscf->timeout);
48
49 if (ngx_handle_read_event(c->read, 0) == NGX_ERROR) {
50 ngx_mail_close_connection(c);
51 }
4652
4753 ngx_mail_send(c->write);
4854 }