evseevnn-zz / php-cassandra-binary

PHP library for Cassandra database via a binary protocol.
http://evseevnn.github.io/php-cassandra-binary/
MIT License
69 stars 33 forks source link

Preventing infinite hang on socket read #71

Closed krisnova closed 8 years ago

krisnova commented 9 years ago

This was hanging for me pretty bad. I just added a quick check to see if the amount of iterations exceeds the total length passed to the method.

It should be safe to say, that if $cleng < 0, we aren't receiving data from the socket. We should error, instead of infinitely hanging.

I think the error stems from having a bad rpc_address directive in the .yaml file (0.0.0.0) But either way, I think we should error, instead of hanging.

krisnova commented 8 years ago

out dated PRs are now fun :(