Skip to content

Commit

Permalink
Add error handling for very first packet from server (Fixes #101)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi committed Dec 24, 2020
1 parent 03c6954 commit 8d57ecc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Internal/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,10 @@ private function parseMysql(): \Generator
private function parsePayload(string $packet): void
{
if ($this->connectionState === self::UNCONNECTED) {
if (\ord($packet) == self::ERR_PACKET) {
$this->handleError($packet);
return;
}
$this->established();
$this->connectionState = self::ESTABLISHED;
$this->handleHandshake($packet);
Expand Down

0 comments on commit 8d57ecc

Please sign in to comment.