Open GoogleCodeExporter opened 8 years ago
I believe you're calculating the payload lengths incorrectly with the 16 bit
and 64 bit values.
For example:
$length=ord($msg[$index])+ord($msg[$index+1])
You're summing the two byte values together there, instead of considering them
as one 16 bit number. I'm pretty sure it should be something like:
$length = (ord($msg[$index]) << 8) | ord($msg[$index + 1]); // shifts 8 bits
left and adds the second byte
In addition at the line:
return $payload.processMsg(substr($msg,$index));
I think you meant calling the function recursively, thus the correct function
name would be unwrap(), or then I missed the other function :).
Original comment by terho.si...@gmail.com
on 6 Apr 2012 at 1:24
Original issue reported on code.google.com by
tuser...@gmail.com
on 6 Feb 2012 at 6:43Attachments: