MINOR: pollers: add a new flag to indicate pollers reporting ERR & HUP

In practice it's all pollers except select(). It turns out that we're
keeping some legacy code only for select and enforcing it on all
pollers, let's offer the pollers the ability to declare that they
do not need that.
This commit is contained in:
Willy Tarreau 2019-11-28 18:17:33 +01:00
parent 8081abe26a
commit 11ef0837af
5 changed files with 6 additions and 5 deletions

View File

@ -162,7 +162,8 @@ struct fdinfo {
* - flags indicate what the poller supports (HAP_POLL_F_*) * - flags indicate what the poller supports (HAP_POLL_F_*)
*/ */
#define HAP_POLL_F_RDHUP 0x00000001 /* the poller notifies of HUP with reads */ #define HAP_POLL_F_RDHUP 0x00000001 /* the poller notifies of HUP with reads */
#define HAP_POLL_F_ERRHUP 0x00000002 /* the poller reports ERR and HUP */
struct poller { struct poller {
void *private; /* any private data for the poller */ void *private; /* any private data for the poller */

View File

@ -360,7 +360,7 @@ static void _do_register(void)
p->name = "epoll"; p->name = "epoll";
p->pref = 300; p->pref = 300;
p->flags = 0; p->flags = HAP_POLL_F_ERRHUP; // note: RDHUP might be dynamically added
p->private = NULL; p->private = NULL;
p->clo = __fd_clo; p->clo = __fd_clo;

View File

@ -422,7 +422,7 @@ static void _do_register(void)
p->name = "evports"; p->name = "evports";
p->pref = 300; p->pref = 300;
p->flags = 0; p->flags = HAP_POLL_F_ERRHUP;
p->private = NULL; p->private = NULL;
p->clo = NULL; p->clo = NULL;

View File

@ -358,7 +358,7 @@ static void _do_register(void)
p->name = "kqueue"; p->name = "kqueue";
p->pref = 300; p->pref = 300;
p->flags = HAP_POLL_F_RDHUP; p->flags = HAP_POLL_F_RDHUP | HAP_POLL_F_ERRHUP;
p->private = NULL; p->private = NULL;
p->clo = NULL; p->clo = NULL;

View File

@ -328,7 +328,7 @@ static void _do_register(void)
p->name = "poll"; p->name = "poll";
p->pref = 200; p->pref = 200;
p->flags = 0; p->flags = HAP_POLL_F_ERRHUP;
p->private = NULL; p->private = NULL;
p->clo = __fd_clo; p->clo = __fd_clo;