I've read the readPacket private function and found the implementation way to naive to be used in production systems.
When $packet = fread($this->_sock, self::HEADER_LEN) is called on line 382 the returned value is considered to be either false or a 8 byte string. In reality this string can have any length up to 8 bytes.
This problem does not occur when reading the content, because reading won't stop until $resp['contentLength'] bytes are read, but the fread($this->_sock, $resp['paddingLength']) call suffers from the same problem.
I've read the readPacket private function and found the implementation way to naive to be used in production systems.
When
$packet = fread($this->_sock, self::HEADER_LEN)
is called on line 382 the returned value is considered to be either false or a 8 byte string. In reality this string can have any length up to 8 bytes.This problem does not occur when reading the content, because reading won't stop until
$resp['contentLength']
bytes are read, but thefread($this->_sock, $resp['paddingLength'])
call suffers from the same problem.