PHP-FastCGI-Client icon indicating copy to clipboard operation
PHP-FastCGI-Client copied to clipboard

fread() implementation

Open langemeijer opened this issue 10 years ago • 0 comments

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.

langemeijer avatar Nov 11 '15 09:11 langemeijer