]> git.kaiwu.me - nginx.git/commit
Events: validate descriptor before FD_SET()
authorSourav Bhowmik <s.bhowmik@f5.com>
Wed, 22 Jul 2026 16:12:28 +0000 (09:12 -0700)
committerSergey Kandaurov <s.kandaurov@f5.com>
Fri, 24 Jul 2026 16:31:03 +0000 (20:31 +0400)
commit0cb3d7fb132558a02bbeada6542fd6c808b7af76
tree3680b3e179b240e0dbdb74b4f17994427d6a384f
parent5e0deb7018b06cdebafab5570b2e9fdf7c3f22de
Events: validate descriptor before FD_SET()

The check in ngx_select_init_conf() can be insufficient because it
doesn't cover descriptors for local files, which are not accounted
for in cycle->connection_n.  For instance, to reach this condition
with new connections, no reusable connections must be available for
recycling in ngx_get_connection().

The fix adopts a similar code from the win32 select module.
src/event/modules/ngx_select_module.c