aboutsummaryrefslogtreecommitdiff
path: root/src/mail/ngx_mail_smtp_handler.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2021-03-05 17:16:16 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2021-03-05 17:16:16 +0300
commit8ed63c936c1493a25bdcb351a812de1ebac8b976 (patch)
tree55307502c8769cd28079580c53edf0051dbec678 /src/mail/ngx_mail_smtp_handler.c
parentd5a31fdad50dbd28974cb0eb7f23948241a7559e (diff)
downloadnginx-8ed63c936c1493a25bdcb351a812de1ebac8b976.tar.gz
nginx-8ed63c936c1493a25bdcb351a812de1ebac8b976.zip
Mail: added missing event handling after blocking events.
As long as a read event is blocked (ignored), ngx_handle_read_event() needs to be called to make sure no further notifications will be triggered when using level-triggered event methods, such as select() or poll().
Diffstat (limited to 'src/mail/ngx_mail_smtp_handler.c')
-rw-r--r--src/mail/ngx_mail_smtp_handler.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mail/ngx_mail_smtp_handler.c b/src/mail/ngx_mail_smtp_handler.c
index f1017e0d8..dcf658eef 100644
--- a/src/mail/ngx_mail_smtp_handler.c
+++ b/src/mail/ngx_mail_smtp_handler.c
@@ -449,6 +449,12 @@ ngx_mail_smtp_auth_state(ngx_event_t *rev)
if (s->out.len) {
ngx_log_debug0(NGX_LOG_DEBUG_MAIL, c->log, 0, "smtp send handler busy");
s->blocked = 1;
+
+ if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
+ ngx_mail_close_connection(c);
+ return;
+ }
+
return;
}