Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #106 from jrdiaz/master
Browse files Browse the repository at this point in the history
Fix for read function not reading the correct number of bytes
  • Loading branch information
Taluu committed May 27, 2015
2 parents e780c8c + 232393b commit 2452d2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Engine/AbstractSocketIO.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public function read()

// the second byte contains the mask bit and the payload's length
$data .= $part = fread($this->stream, 1);
$length = (int) (bin2hex($part) & ~0x80); // removing the mask bit
$mask = (bool) (bin2hex($part) & 0x80);
$length = hexdec(bin2hex($part) & ~0x80); // removing the mask bit
$mask = (bool)(bin2hex($part) & 0x80);

/*
* Here is where it is getting tricky :
Expand Down

0 comments on commit 2452d2d

Please sign in to comment.