handle bad packet more correctly
This commit is contained in:
parent
d6f0dc83d3
commit
1517ba0a4b
|
@ -27,9 +27,10 @@ module.exports.create = function (cli, dnsd) {
|
|||
|
||||
// TODO pad two bytes for lengths
|
||||
dnsd.onMessage(nb, function (err, newAb, dbgmsg) {
|
||||
var lenbuf = Buffer.from([ newAb.length >> 8, newAb.length & 255 ]);
|
||||
// TODO XXX generate legit error packet
|
||||
if (err) { console.error("Error", err); c.end(); return; }
|
||||
|
||||
var lenbuf = Buffer.from([ newAb.length >> 8, newAb.length & 255 ]);
|
||||
console.log('TCP ' + dbgmsg);
|
||||
|
||||
c.write(lenbuf);
|
||||
|
|
Loading…
Reference in New Issue