Skip to content

Commit

Permalink
Merge pull request #66 from Domochip/master
Browse files Browse the repository at this point in the history
Fix PR65 Undefined variable
  • Loading branch information
cboden authored Aug 18, 2022
2 parents 382a3ed + fe3db0a commit 82760a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Messaging/MessageBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public function onData($data) {
$payload_length = unpack('C', $data[$frameStart + 1] & "\x7f")[1];
$isMasked = ($data[$frameStart + 1] & "\x80") === "\x80";
$headerSize += $isMasked ? 4 : 0;
$payloadLenOver2GB = false;
if ($payload_length > 125 && ($dataLen - $frameStart < $headerSize + 125)) {
// no point of checking - this frame is going to be bigger than the buffer is right now
break;
Expand All @@ -158,7 +159,6 @@ public function onData($data) {
$payloadLenBytes = $payload_length === 126 ? 2 : 8;
$headerSize += $payloadLenBytes;
$bytesToUpack = substr($data, $frameStart + 2, $payloadLenBytes);
$payloadLenOver2GB = false;

if ($payload_length === 126){
$payload_length = unpack('n', $bytesToUpack)[1];
Expand Down

0 comments on commit 82760a7

Please sign in to comment.