]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: kqueue: take care of EV_EOF to improve polling status accuracy
authorWilly Tarreau <w@1wt.eu>
Mon, 13 Mar 2017 19:36:48 +0000 (20:36 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Mar 2017 15:35:17 +0000 (16:35 +0100)
commit19c4ab97c10b75b69d02bf7ebb6c2c3331d7bd83
tree04ea0b92da312eb9a55f54105102919240221e7f
parentdd437d9a4c4ff6aa2d4003ab121790ae08020784
MEDIUM: kqueue: take care of EV_EOF to improve polling status accuracy

kevent() always sets EV_EOF with EVFILT_READ to notify of a read shutdown
and EV_EOF with EVFILT_WRITE to notify of a write error. Let's check this
flag to properly update the FD's polled status (FD_POLL_HUP and FD_POLL_ERR
respectively).

It's worth noting that this one can be coupled with a regular read event
to notify about a pending read followed by a shutdown, but for now we only
use this to set the relevant flags (HUP and ERR).

The poller now exhibits the flag HAP_POLL_F_RDHUP to indicate this new
capability.

An improvement may consist in not setting FD_POLL_IN when the "data"
field is null since it normally only reflects the amount of pending
data.
src/ev_kqueue.c