Mercurial > hg > nginx
comparison src/mail/ngx_mail_pop3_handler.c @ 9234:c690a902bfec
Mail: handling of read buffer filled with commands.
If the whole read buffer was filled with commands during authentication,
exactly matching the buffer boundary, this did not cause the "client sent
too long command" error, but might result in read events being disabled
for the connection, notably with level-triggered event methods, leading
to a connection hang.
Fix is to ensure that s->blocked is set in case of c->read->ready, so
command reading is resumed after sending responses to previous commands.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 30 Mar 2024 05:05:05 +0300 |
parents | 815c63581be4 |
children | d7fd0acdea64 |
comparison
equal
deleted
inserted
replaced
9233:9ca12c957304 | 9234:c690a902bfec |
---|---|
260 rc = ngx_mail_auth_external(s, c, 0); | 260 rc = ngx_mail_auth_external(s, c, 0); |
261 break; | 261 break; |
262 } | 262 } |
263 } | 263 } |
264 | 264 |
265 if (s->buffer->pos < s->buffer->last) { | 265 if (s->buffer->pos < s->buffer->last || c->read->ready) { |
266 s->blocked = 1; | 266 s->blocked = 1; |
267 } | 267 } |
268 | 268 |
269 switch (rc) { | 269 switch (rc) { |
270 | 270 |