You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
Send two frames in a very short time
socket.send('message1')
socket.send('message2')
As result, the decoding function does not understand when first frame end and
second one start, which causes it handle two frame as single. This lead broken
output.
Decode function is:
private function decode ($msg) {
$len = $data = $decoded = $index = null;
$len = $msg[1] & 127;
if ($len === 126) {
$this->masks = substr ($msg, 4, 4);
$data = substr ($msg, 8);
$this->initFrame = substr ($msg, 0, 4);
}
else if ($len === 127) {
$this->masks = substr ($msg, 10, 4);
$data = substr ($msg, 14);
$this->initFrame = substr ($msg, 0, 10);
}
else {
$this->masks = substr ($msg, 2, 4);
$data = substr ($msg, 6);
$this->initFrame = substr ($msg, 0, 2);
}
for ($index = 0; $index < strlen ($data); $index++) {
$decoded .= $data[$index] ^ $this->masks[$index % 4];
}
return $decoded;
}
----------------
Should there be some regonizion when frame end and then attach rest of the
message to second frame?
Original issue reported on code.google.com by [email protected] on 15 Nov 2012 at 9:35
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 15 Nov 2012 at 9:35The text was updated successfully, but these errors were encountered: