0.4/0.5 to 0.6.1, Very weird TypeError: Object ??? --> 2/3/4 unknown characters #2138
Comments
What does the buffer object contain at the time of the |
/* TTL (32-bit signed integer) durasi cache.*/
console.log(buff);
console.log(buff.length);
console.log(start);
rr.TTL = buff.readInt32BE(start) // TODO: error at 0.6.1 <SlowBuffer aa 8d 81 80 00 01 00 05 00 00 00 00 06 67 6f 6f 67 6c 65 03 63 6f 6d 00 00 01 00 01 c0 0c 00 01 00 01 00 00 00 eb 00 04 ad c2 21 34 c0 0c 00 01 00 01 00 ...>
108
34
/home/***/Documents/S2.iSTTS/thesis/NDNS/dnsServer.js:294
rr.TTL = buff.readInt32BE(start) // TODO: error at 0.6.1
^
TypeError: Object ���� |
/* TTL (32-bit signed integer) durasi cache.*/
config.debugMode = true;
d.logBin(buff);
console.log(buff.length);
console.log(start);
rr.TTL = buff.readInt32BE(start) // TODO: error at 0.6.1 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
000 > ed bd 81 80 00 01 00 05 00 00 00 00 06 67 6f 6f 67 6c 65 03 63 6f 6d 00 00 01 00 01 c0 0c 00 01
032 > 00 01 00 00 00 08 00 04 ad c2 21 30 c0 0c 00 01 00 01 00 00 00 08 00 04 ad c2 21 31 c0 0c 00 01
064 > 00 01 00 00 00 08 00 04 ad c2 21 32 c0 0c 00 01 00 01 00 00 00 08 00 04 ad c2 21 33 c0 0c 00 01
096 > 00 01 00 00 00 08 00 04 ad c2 21 34
108
34
/home/***/Documents/S2.iSTTS/thesis/NDNS/dnsServer.js:295
rr.TTL = buff.readInt32BE(start) // TODO: error at 0.6.1
^
TypeError: Object �� |
Confirmed, SlowBuffer doesn't have the .read*() functions. Test case: var SlowBuffer = process.binding('buffer').SlowBuffer;
var b = new SlowBuffer(4);
b.write('1234', 0, 4, 'binary');
b.readInt32BE(0); // throws |
Can someone review bnoordhuis/node@771243f? |
Is |
The C++ |
There's also this "technique" for returning regular |
IIRC I'm the one that originally explained to the guy how to create FastBuffers like that. :-) Okay, I hope that we have established that SlowBuffers are sometimes unavoidable. Can someone look at bnoordhuis/node@771243f and say if it's any good? |
I took a quick look. Seems reasonable. Test pass I assume? |
@bnoordhuis - Thanks, the patch LGTM (except the last line of But I do not know why |
if i was not mistaken.. On Fri 18 Nov 2011 02:39:12 PM WIT, Koichi Kobayashi wrote:
|
var dgram = require('dgram');
var server = dgram.createSocket('udp4');
var requests = {};
server
.on("message", function (msg, rinfo) { it's created by dgram.createSocket('udp4'); this is the result when using node 0.5.5pre (git) <Buffer 30 61 81 80 00 01 00 05 00 00 00 00 06 67 6f 6f 67 6c 65 03 63
6f 6d 00 00 01 00 01 c0 0c 00 01 00 01 00 00 00 40 00 04 ad c2 21 32 c0
0c 00 01 00 01 00 ...>
108 On Fri 18 Nov 2011 05:17:12 PM WIT, Ben Noordhuis wrote:
|
buff is SlowBuffer object
i'm using chris-lea PPA on Ubuntu 11.10 64-bit
this does not happened when i use 0.4.x (PPA) or 0.5.x (git, manual compile)
The text was updated successfully, but these errors were encountered: