summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2020-03-04 14:03:30 +0300
committerIgor Sysoev <igor@sysoev.ru>2020-03-04 14:03:30 +0300
commit2d0dca52431c08f5f7650ce7bad5a1bc680fa150 (patch)
treeedcd95ac6854267b149e720b6a38c3a9330cb8d2 /src
parentafa2f86ecf3ff99b598b14b3448c056b914cd32a (diff)
downloadunit-2d0dca52431c08f5f7650ce7bad5a1bc680fa150.tar.gz
unit-2d0dca52431c08f5f7650ce7bad5a1bc680fa150.tar.bz2
The kqueue EOF flag might be ignored on some conditions.
If kqueue reported both the EVFILT_READ and the EVFILT_WRITE events for the socket but only the former had the EV_EOF flag set, the flag was silently ignored.
Diffstat (limited to '')
-rw-r--r--src/nxt_kqueue_engine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_kqueue_engine.c b/src/nxt_kqueue_engine.c
index 9edbc346..ecc3251e 100644
--- a/src/nxt_kqueue_engine.c
+++ b/src/nxt_kqueue_engine.c
@@ -747,7 +747,7 @@ nxt_kqueue_poll(nxt_event_engine_t *engine, nxt_msec_t timeout)
err = kev->fflags;
eof = (kev->flags & EV_EOF) != 0;
ev->kq_errno = err;
- ev->kq_eof = eof;
+ ev->kq_eof |= eof;
if (ev->read <= NXT_EVENT_BLOCKED) {
nxt_debug(ev->task, "blocked read event fd:%d", ev->fd);
@@ -778,7 +778,7 @@ nxt_kqueue_poll(nxt_event_engine_t *engine, nxt_msec_t timeout)
err = kev->fflags;
eof = (kev->flags & EV_EOF) != 0;
ev->kq_errno = err;
- ev->kq_eof = eof;
+ ev->kq_eof |= eof;
if (ev->write <= NXT_EVENT_BLOCKED) {
nxt_debug(ev->task, "blocked write event fd:%d", ev->fd);