Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make sure stream exists when checking for EOF.

Addressing issue #143.
  • Loading branch information...
commit 4cf7677d05ea35bbea171411a0bc6a5aa2662883 1 parent c18dcca
@nicolasff nicolasff authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 library.c
View
7 library.c
@@ -31,8 +31,13 @@ PHPAPI void redis_stream_close(RedisSock *redis_sock TSRMLS_DC) {
PHPAPI int redis_check_eof(RedisSock *redis_sock TSRMLS_DC)
{
- int eof = php_stream_eof(redis_sock->stream);
+ int eof;
int count = 0;
+
+ if (!redis_sock->stream)
+ return -1;
+
+ eof = php_stream_eof(redis_sock->stream);
while(eof) {
if((MULTI == redis_sock->mode) || redis_sock->watching || count++ == 10) { /* too many failures */
if(redis_sock->stream) { /* close stream if still here */
Please sign in to comment.
Something went wrong with that request. Please try again.