]> git.kaiwu.me - nginx.git/commit
Win32: detection of connect() errors in select().
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 24 Jan 2019 19:00:44 +0000 (22:00 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 24 Jan 2019 19:00:44 +0000 (22:00 +0300)
commit38196b8ba63f04830db0b8793eca738e162c6d8e
treed15f9f6054d5eaeb2cad2e9c2c92b369f76f8185
parentf2cfcc09a05670583bbbf9ab193eb743892f7da1
Win32: detection of connect() errors in select().

On Windows, connect() errors are only reported via exceptfds descriptor set
from select().  Previously exceptfds was set to NULL, and connect() errors
were not detected at all, so connects to closed ports were waiting till
a timeout occurred.

Since ongoing connect() means that there will be a write event active,
except descriptor set is copied from the write one.  While it is possible
to construct except descriptor set as a concatenation of both read and write
descriptor sets, this looks unneeded.

With this change, connect() errors are properly detected now when using
select().  Note well that it is not possible to detect connect() errors with
WSAPoll() (see https://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/).
src/event/modules/ngx_win32_select_module.c