getdnsapi / getdns

A modern asynchronous DNS API https://getdnsapi.net/
Other
468 stars 126 forks source link

only check for and process read/write events if status is success #486

Closed elindsey closed 4 years ago

elindsey commented 4 years ago

Unlike libevent, libuv has a separate status flag for errors that occur while polling. Thus there's an edge case today where an error during poll will call getdns_libuv_cb with a status < 1 and an event that is neither UV_READABLE nor UV_WRITABLE, triggering an ASSERT_UNREACHABLE crash.

Work around this by only calling our read/write callbacks if the poll status is non error.

wtoorop commented 4 years ago

Ack! Thanks for this correction!