diff --git a/packer/type.txt.js b/packer/type.txt.js index 93cfb4f..dee1b66 100644 --- a/packer/type.txt.js +++ b/packer/type.txt.js @@ -10,24 +10,32 @@ exports.DNS_PACKER_TYPE_TXT = function (ab, dv, total, record) { var txtLen = 0; var rdLenIndex = total; - total += 2; + total += 3; // RDATA + console.log("what is my record data: " + typeof record.data[0]); + console.log("what are my labels? "); + // var res = record.data[0].split(" "); + // console.log("Res: " + res); - record.data.split('.').forEach(funtion(label){ - txtLen += 1 + label.length; + console.log("for each rdata"); + record.data.forEach(function(str){ - dv.setUint8(total, label.length, false); + str.split('').forEach(function(ch){ + + + txtLen += 1; + // console.log(chcim); + dv.setUint8(total, ch.charCodeAt(0), false); total += 1; - - label.split('').forEach(function (ch) { - dv.setUint8(total, ch.charCodeAt(0), false); - total += 1; + }); }); - - dv.setUint16(rdLenIndex, record.data.length + 1, flase);s + console.log("txt rdata length is: " + txtLen); + dv.setUint16(rdLenIndex, txtLen+1, false); + dv.setUint8(rdLenIndex+2, txtLen, false); + // total +=1; return total; };