Comparing version 0.6.2 to 0.6.3
@@ -32,2 +32,3 @@ /*! | ||
Record, | ||
opcodes, | ||
types | ||
@@ -250,4 +251,18 @@ } = wire; | ||
const result = await this.ub.resolve(qs.name, qs.type, qs.class); | ||
const msg = Message.decode(result.msg); | ||
let msg; | ||
if (result.answerPacket) { | ||
msg = Message.decode(result.answerPacket); | ||
} else { | ||
msg = new Message(); | ||
msg.id = 0; | ||
msg.opcode = opcodes.QUERY; | ||
msg.code = result.rcode; | ||
msg.qr = true; | ||
msg.ra = true; | ||
msg.ad = false; | ||
msg.question = [qs.clone()]; | ||
} | ||
if (result.secure && !result.bogus) | ||
@@ -284,10 +299,9 @@ msg.ad = true; | ||
function tempFile(name) { | ||
const a = (Math.random() * 0x100000000) >>> 0; | ||
const b = (Math.random() * 0x100000000) >>> 0; | ||
const an = a.toString(32); | ||
const bn = b.toString(32); | ||
const rand = (Math.random() * 0x100000000) >>> 0; | ||
const pid = process.pid.toString(32); | ||
const now = Date.now().toString(32); | ||
const tag = rand.toString(32); | ||
const file = `${name}-${pid}-${now}-${tag}.zone`; | ||
const n = `${name}-${an}${bn}.zone`; | ||
return Path.resolve(os.tmpdir(), n); | ||
return Path.resolve(os.tmpdir(), file); | ||
} | ||
@@ -294,0 +308,0 @@ |
{ | ||
"name": "bns", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"description": "DNS bike-shed", | ||
@@ -49,3 +49,3 @@ "keywords": [ | ||
"optionalDependencies": { | ||
"unbound": "~0.2.3" | ||
"unbound": "~0.3.0" | ||
}, | ||
@@ -52,0 +52,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
672922
25812