Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fread() implementation #11

Open
langemeijer opened this issue Nov 11, 2015 · 0 comments
Open

fread() implementation #11

langemeijer opened this issue Nov 11, 2015 · 0 comments

Comments

@langemeijer
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant