Skip to content

Commit

Permalink
Merge pull request #61 from WarriorXK/hotfix/2.6.3
Browse files Browse the repository at this point in the history
Hotfix/2.6.3
  • Loading branch information
WarriorXK authored Jun 17, 2020
2 parents 38928d6 + cc01eb1 commit 58d4381
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.2
2.6.3
12 changes: 10 additions & 2 deletions src/PHPWebSockets/AConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,18 @@ protected function _handlePacket(string $newData) : \Generator {

if ($headers[Framer::IND_FIN]) {

yield new Update\Read(Update\Read::C_READ, $this, $this->_partialMessageOpcode, $this->_partialMessage, $this->_partialMessageStream);

$newMessageOpCode = $this->_partialMessageOpcode;
$newMessageData = $this->_partialMessage;
$newMessageStream = $this->_partialMessageStream;

/*
* We have to call _resetFrameData before yielding the update
* If we don't, and the handler of the update tries to send and wait for a new reply we'd error with a C_READ_INVALID_PAYLOAD since we assume the message we're yielding the event for hasn't been completed yet
*/
$this->_resetFrameData();

yield new Update\Read(Update\Read::C_READ, $this, $newMessageOpCode, $newMessageData, $newMessageStream);

}

break;
Expand Down

0 comments on commit 58d4381

Please sign in to comment.