MINOR: fd: add a new flag HAP_POLL_F_RDHUP to struct poller
authorWilly Tarreau <w@1wt.eu>
Mon, 13 Mar 2017 10:38:28 +0000 (11:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Mar 2017 15:30:35 +0000 (16:30 +0100)
commit5a767693b5c068b1142ddb540b9aeb26748fcdfc
tree59f08ca0ff545453dda264e04fff204b5381479e
parente39683c4d4c527d1b561c3ba3983d26cc3e7f42d
MINOR: fd: add a new flag HAP_POLL_F_RDHUP to struct poller

We'll need to differenciate between pollers which can report hangup at
the same time as read (POLL_RDHUP) from the other ones, because only
these ones may benefit from the fd_done_recv() optimization. Epoll has
had support for EPOLLRDHUP since Linux 2.6.17 and has always been used
this way in haproxy, so now we only set the flag once we've observed it
once in a response. It means that some initial requests may try to
perform a second recv() call, but after the first closed connection it
will be enough to know that the second call is not needed anymore.

Later we may extend these flags to designate event-triggered pollers.
include/types/fd.h
src/ev_epoll.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c