]> git.kaiwu.me - nginx.git/commit
Mail: blocked client writes while waiting for auth_http response
authorVadim Zhestikov <v.zhestikov@f5.com>
Wed, 4 Nov 2026 17:54:11 +0000 (09:54 -0800)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 11 Nov 2026 18:08:26 +0000 (22:08 +0400)
commite2d23d45fa93ed236a9cdedcb54271e0a064c4f3
treed4a873d90999f72da3e17cb1fd1f155a19bc5255
parentdf9d8d940ecb83a50b1e55ccc296d0a29cfe774c
Mail: blocked client writes while waiting for auth_http response

While waiting for the auth_http response, the client read handler is
ngx_mail_auth_http_block_read(), but the write handler was left as
ngx_mail_send(), so a client write event during the wait was handled
by a function which can close the client connection, destroying the
session while the auth_http connection still referenced it.

The client write handler is now blocked while waiting for the auth_http
response, with proper cleanup on errors, and restored right after the
auth_http connection is closed.
src/mail/ngx_mail_auth_http_module.c