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.
This commit is contained in:
Igor Sysoev
2020-03-04 14:03:30 +03:00
parent afa2f86ecf
commit 2d0dca5243

View File

@@ -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);