Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix test-domains.js

  • Loading branch information
ry committed Sep 19, 2011
1 parent 8d90ae2 commit 517604bcfbbd510a903393bfe58c13af7f6d603b
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/dns_uv.js
@@ -135,6 +135,10 @@ exports.lookup = function(domain, family, callback) {
} */

function onanswer(status, addresses, familySym) {
if (process.features.domains) {
require('domains').remove(wrap);
}

if (!status) {
callback(null, addresses[0], symToFamily(familySym));
} else {
@@ -163,6 +167,10 @@ exports.lookup = function(domain, family, callback) {
throw errnoException(errno, 'getHostByName');
}

if (process.features.domains) {
require('domains').add(wrap);
}

callback.immediately = true;
return wrap;
};
@@ -173,6 +181,10 @@ function resolver(bindingName) {

return function query(name, callback) {
function onanswer(status, result) {
if (process.features.domains) {
require('domains').remove(wrap);
}

if (!status) {
callback(null, result);
} else {
@@ -186,6 +198,10 @@ function resolver(bindingName) {
throw errnoException(errno, bindingName);
}

if (process.features.domains) {
require('domains').add(wrap);
}

callback.immediately = true;
return wrap;
}

0 comments on commit 517604b

Please sign in to comment.
You can’t perform that action at this time.