mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
MEDIUM: kqueue: only set FD_POLL_IN when there are pending data
Let's avoid setting FD_POLL_IN when there's no pending data. It will save a useless recv() syscall on pure closes.
This commit is contained in:
parent
19c4ab97c1
commit
fa0617660a
@ -125,7 +125,8 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
|
|||||||
fdtab[fd].ev &= FD_POLL_STICKY;
|
fdtab[fd].ev &= FD_POLL_STICKY;
|
||||||
|
|
||||||
if (kev[count].filter == EVFILT_READ) {
|
if (kev[count].filter == EVFILT_READ) {
|
||||||
fdtab[fd].ev |= FD_POLL_IN;
|
if (kev[count].data)
|
||||||
|
fdtab[fd].ev |= FD_POLL_IN;
|
||||||
if (kev[count].flags & EV_EOF)
|
if (kev[count].flags & EV_EOF)
|
||||||
fdtab[fd].ev |= FD_POLL_HUP;
|
fdtab[fd].ev |= FD_POLL_HUP;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user