Merge pull request #486 from elindsey/eli

only check for and process read/write events if status is success
This commit is contained in:
Willem Toorop 2020-10-05 12:34:28 +02:00 committed by GitHub
commit ebeff97192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 17 deletions

View File

@ -134,24 +134,25 @@ static void
getdns_libuv_cb(uv_poll_t *poll, int status, int events) getdns_libuv_cb(uv_poll_t *poll, int status, int events)
{ {
getdns_eventloop_event *el_ev = (getdns_eventloop_event *)poll->data; getdns_eventloop_event *el_ev = (getdns_eventloop_event *)poll->data;
(void)status;
if (events & UV_READABLE) { if (status == 0) {
assert(el_ev->read_cb); if (events & UV_READABLE) {
DEBUG_UV("enter libuv_read_cb(el_ev = %p, el_ev->ev = %p)\n" assert(el_ev->read_cb);
, el_ev, el_ev->ev); DEBUG_UV("enter libuv_read_cb(el_ev = %p, el_ev->ev = %p)\n"
el_ev->read_cb(el_ev->userarg); , el_ev, el_ev->ev);
DEBUG_UV("exit libuv_read_cb(el_ev = %p, el_ev->ev = %p)\n" el_ev->read_cb(el_ev->userarg);
, el_ev, el_ev->ev); DEBUG_UV("exit libuv_read_cb(el_ev = %p, el_ev->ev = %p)\n"
} else if (events & UV_WRITABLE) { , el_ev, el_ev->ev);
assert(el_ev->write_cb); } else if (events & UV_WRITABLE) {
DEBUG_UV("enter libuv_write_cb(el_ev = %p, el_ev->ev = %p)\n" assert(el_ev->write_cb);
, el_ev, el_ev->ev); DEBUG_UV("enter libuv_write_cb(el_ev = %p, el_ev->ev = %p)\n"
el_ev->write_cb(el_ev->userarg); , el_ev, el_ev->ev);
DEBUG_UV("exit libuv_write_cb(el_ev = %p, el_ev->ev = %p)\n" el_ev->write_cb(el_ev->userarg);
, el_ev, el_ev->ev); DEBUG_UV("exit libuv_write_cb(el_ev = %p, el_ev->ev = %p)\n"
} else { , el_ev, el_ev->ev);
assert(ASSERT_UNREACHABLE); } else {
assert(ASSERT_UNREACHABLE);
}
} }
} }