projects
/
haproxy-2.3.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19c4ab9
)
MEDIUM: kqueue: only set FD_POLL_IN when there are pending data
author
Willy Tarreau
<w@1wt.eu>
Mon, 13 Mar 2017 19:49:56 +0000
(20:49 +0100)
committer
Willy Tarreau
<w@1wt.eu>
Tue, 21 Mar 2017 15:35:17 +0000
(16:35 +0100)
Let's avoid setting FD_POLL_IN when there's no pending data. It will
save a useless recv() syscall on pure closes.
src/ev_kqueue.c
patch
|
blob
|
history
diff --git
a/src/ev_kqueue.c
b/src/ev_kqueue.c
index
6f41c73
..
f1c0b8d
100644
(file)
--- a/
src/ev_kqueue.c
+++ b/
src/ev_kqueue.c
@@
-125,7
+125,8
@@
REGPRM2 static void _do_poll(struct poller *p, int exp)
fdtab[fd].ev &= FD_POLL_STICKY;
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)
fdtab[fd].ev |= FD_POLL_HUP;
}