kqueue: ignore write-end closed notifications (#3277)
The combination EVFILT_WRITE+EV_EOF is valid and indicates that the reader has disconnected (called `shutdown(SHUT_RD)`). Probably very rare in practice, but this seems more correct. Issue noticed (for UV_DISCONNECT clients of uv_poll), while doing research for https://github.com/libuv/libuv/pull/3250.
This commit is contained in:
parent
40bf9a89eb
commit
abfc4f0b15
@ -326,6 +326,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
||||
if (errno != ENOENT)
|
||||
abort();
|
||||
}
|
||||
if ((ev->flags & EV_EOF) && (w->pevents & UV__POLLRDHUP))
|
||||
revents |= UV__POLLRDHUP;
|
||||
}
|
||||
|
||||
if (ev->filter == EV_OOBAND) {
|
||||
@ -359,9 +361,6 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
|
||||
if (ev->flags & EV_ERROR)
|
||||
revents |= POLLERR;
|
||||
|
||||
if ((ev->flags & EV_EOF) && (w->pevents & UV__POLLRDHUP))
|
||||
revents |= UV__POLLRDHUP;
|
||||
|
||||
if (revents == 0)
|
||||
continue;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user