forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dns: gate setServers to avoid async cares conflicts
Use an EE with some state data to gate async resolution operations in c-ares so that setServers() can run independently. Likely a temporary fix for nodejs#894 with a better solution being to fix c-ares to do this without barfing.
- Loading branch information
Showing
2 changed files
with
83 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// should not crash | ||
// see https://github.com/iojs/io.js/issues/894 for what this is trying | ||
// to test | ||
|
||
var common = require('../common'); | ||
var assert = require('assert'); | ||
var dns = require('dns'); | ||
|
||
dns.resolve4('www.microsoft.com', function (err, result) { | ||
dns.setServers([ '8.8.8.9' ]); | ||
dns.resolve4('test.com', function (err, result) {}); | ||
}); | ||
dns.setServers([ '8.8.8.8' ]); |