comparison src/mail/ngx_mail_handler.c @ 7790:da0a85e91587

Mail: added missing event handling after reading data. If we need to be notified about further events, ngx_handle_read_event() needs to be called after a read event is processed. Without this, an event can be removed from the kernel and won't be reported again, notably when using oneshot event methods, such as eventport on Solaris. For consistency, existing ngx_handle_read_event() call removed from ngx_mail_read_command(), as this call only covers one of the code paths where ngx_mail_read_command() returns NGX_AGAIN. Instead, appropriate processing added to the callers, covering all code paths where NGX_AGAIN is returned.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 05 Mar 2021 17:16:17 +0300
parents 7f955d3b9a0d
children d84f13618277
comparison
equal deleted inserted replaced
7789:ab6257dac2a8 7790:da0a85e91587
720 if (n > 0) { 720 if (n > 0) {
721 s->buffer->last += n; 721 s->buffer->last += n;
722 } 722 }
723 723
724 if (n == NGX_AGAIN) { 724 if (n == NGX_AGAIN) {
725 if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
726 ngx_mail_session_internal_server_error(s);
727 return NGX_ERROR;
728 }
729
730 if (s->buffer->pos == s->buffer->last) { 725 if (s->buffer->pos == s->buffer->last) {
731 return NGX_AGAIN; 726 return NGX_AGAIN;
732 } 727 }
733 } 728 }
734 729