Mercurial > hg > nginx-quic
comparison src/mail/ngx_mail_pop3_handler.c @ 8339: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 | ab6257dac2a8 |
children | 815c63581be4 |
comparison
equal
deleted
inserted
replaced
8338:ab6257dac2a8 | 8339:da0a85e91587 |
---|---|
149 | 149 |
150 s->blocked = 0; | 150 s->blocked = 0; |
151 | 151 |
152 rc = ngx_mail_read_command(s, c); | 152 rc = ngx_mail_read_command(s, c); |
153 | 153 |
154 if (rc == NGX_AGAIN || rc == NGX_ERROR) { | 154 if (rc == NGX_AGAIN) { |
155 if (ngx_handle_read_event(c->read, 0) != NGX_OK) { | |
156 ngx_mail_session_internal_server_error(s); | |
157 return; | |
158 } | |
159 | |
160 return; | |
161 } | |
162 | |
163 if (rc == NGX_ERROR) { | |
155 return; | 164 return; |
156 } | 165 } |
157 | 166 |
158 ngx_str_set(&s->out, pop3_ok); | 167 ngx_str_set(&s->out, pop3_ok); |
159 | 168 |
277 s->buffer->pos = s->buffer->start; | 286 s->buffer->pos = s->buffer->start; |
278 s->buffer->last = s->buffer->start; | 287 s->buffer->last = s->buffer->start; |
279 | 288 |
280 if (s->state) { | 289 if (s->state) { |
281 s->arg_start = s->buffer->start; | 290 s->arg_start = s->buffer->start; |
291 } | |
292 | |
293 if (ngx_handle_read_event(c->read, 0) != NGX_OK) { | |
294 ngx_mail_session_internal_server_error(s); | |
295 return; | |
282 } | 296 } |
283 | 297 |
284 ngx_mail_send(c->write); | 298 ngx_mail_send(c->write); |
285 } | 299 } |
286 } | 300 } |