dns: fix c-ares error reporting regression
The test case from the previous commit exposed a regression in the way that c-ares errors are reported to JS land. Said regression was introduced in commit 756b6222 ("src: add multi-context support"). Fixes the following test failure: $ out/Release/node test/simple/test-dns-regress-6244 util.js:675 var errname = uv.errname(err); ^ Error: err >= 0 at Object.exports._errnoException (util.js:675:20) at errnoException (dns.js:43:15) at Object.onresolve [as oncomplete] (dns.js:145:19) lib/dns.js erroneously assumed that the error code was a libuv error code when it's really a c-ares status code. Libuv handles getaddrinfo() style lookups (which is by far the most common type of lookup), that's why this bug wasn't discovered earlier.
parent
a0f79867
Please register or sign in to comment