ws, remove cruft

This commit is contained in:
AJ ONeal 2017-10-06 19:27:37 -06:00
parent a5586f6b2c
commit 6b8a8664f8
1 changed files with 5 additions and 10 deletions

View File

@ -1,28 +1,24 @@
(function (exports) { (function (exports) {
'use strict'; 'use strict';
// NS name for the supplied domain. May be label, pointer or any combination // NS name for the supplied domain. May be label, pointer or any combination
exports.DNS_PACKER_TYPE_NS = function (ab, dv, total, record) { exports.DNS_PACKER_TYPE_NS = function (ab, dv, total, record) {
if(!record.data){ if (!record.data) {
throw new Error("no data on NS record"); throw new Error("no data on NS record");
} }
var nsLen = 0;
var rdLenIndex = total; var rdLenIndex = total;
total +=2; total +=2;
// RDATA // RDATA
// a sequence of labels // a sequence of labels
record.data.split('.').forEach(function(label) { record.data.split('.').forEach(function (label) {
nsLen += 1 + label.length;
dv.setUint8(total, label.length, false); dv.setUint8(total, label.length, false);
total += 1; total += 1;
label.split('').forEach(function (ch){ label.split('').forEach(function (ch) {
dv.setUint8(total, ch.charCodeAt(0), false); dv.setUint8(total, ch.charCodeAt(0), false);
total += 1; total += 1;
}); });
@ -31,7 +27,6 @@ exports.DNS_PACKER_TYPE_NS = function (ab, dv, total, record) {
// RDLENGTH // RDLENGTH
dv.setUint16(rdLenIndex, record.data.length + 1, false); dv.setUint16(rdLenIndex, record.data.length + 1, false);
return total; return total;
}; };