]> git.kaiwu.me - nginx.git/commit
Mail: fixed reading with fully filled buffer (ticket #2159).
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 21 Apr 2021 20:24:59 +0000 (23:24 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 21 Apr 2021 20:24:59 +0000 (23:24 +0300)
commit7b9920aad80299d79f4dba08de36693804f8751c
tree6869e939b45905b45b51b511c2a5a398ff92652a
parentead9ab09255042559c5568cb5959a487fbef2fab
Mail: fixed reading with fully filled buffer (ticket #2159).

With SMTP pipelining, ngx_mail_read_command() can be called with s->buffer
without any space available, to parse additional commands received to the
buffer on previous calls.  Previously, this resulted in recv() being called
with zero length, resulting in zero being returned, which was interpreted
as a connection close by the client, so nginx silently closed connection.

Fix is to avoid calling c->recv() if there is no free space in the buffer,
but continue parsing of the already received commands.
src/mail/ngx_mail_handler.c