comparison src/mail/ngx_mail_handler.c @ 5632:b42e7c790b81

Mail: fixed ngx_mail_send() (ticket #519).
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 31 Mar 2014 21:38:27 +0400
parents 957d734362ed
children d5b8ee9f2201
comparison
equal deleted inserted replaced
5631:f1dfe7ff4511 5632:b42e7c790b81
557 } 557 }
558 558
559 n = c->send(c, s->out.data, s->out.len); 559 n = c->send(c, s->out.data, s->out.len);
560 560
561 if (n > 0) { 561 if (n > 0) {
562 s->out.data += n;
562 s->out.len -= n; 563 s->out.len -= n;
564
565 if (s->out.len != 0) {
566 goto again;
567 }
563 568
564 if (wev->timer_set) { 569 if (wev->timer_set) {
565 ngx_del_timer(wev); 570 ngx_del_timer(wev);
566 } 571 }
567 572
581 ngx_mail_close_connection(c); 586 ngx_mail_close_connection(c);
582 return; 587 return;
583 } 588 }
584 589
585 /* n == NGX_AGAIN */ 590 /* n == NGX_AGAIN */
591
592 again:
586 593
587 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); 594 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
588 595
589 ngx_add_timer(c->write, cscf->timeout); 596 ngx_add_timer(c->write, cscf->timeout);
590 597