Commit Graph

3 Commits

Author SHA1 Message Date
XadillaX
b3678dff52
dns: fix crash while setting server during query
Fix this issue follow these two points:

1. Keep track of how many queries are currently open. If `setServers()`
   is called while there are open queries, error out.
2. For `Resolver` instances, use option 1. For dns.setServers(), just
   create a fresh new default channel every time it is called, and then
   set its servers list.

PR-URL: https://github.com/nodejs/node/pull/14891
Fixes: https://github.com/nodejs/node/issues/14734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-12-06 04:22:31 +01:00
Joyee Cheung
5dca787993 test: use internet.addresses in internet tests
PR-URL: https://github.com/nodejs/node/pull/16390
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-08 18:54:20 +08:00
XadillaX
5a948f6f64
dns: fix crash using dns.setServers after resolve4
The callback function in cares_query is synchronous and called before
closed. So dns.setServers in the synchronous callback before closed will
occur crashing.

Fixes: https://github.com/nodejs/node/issues/894
Refs: https://github.com/nodejs/node/blob/v6.9.4/deps/cares/src/ares_process.c#L1332-L1333
Refs: https://github.com/OpenSIPS/opensips/blob/2.3.0/proxy.c
PR-URL: https://github.com/nodejs/node/pull/13050
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-05-18 23:09:08 +02:00