diff options
author | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2010-10-28 13:06:28 +0400 |
---|---|---|
committer | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2010-10-28 13:06:28 +0400 |
commit | da074dda313685679607f550a470ab97b5079b90 (patch) | |
tree | 0cb561cd8bae99f6520bd36a09461a8890f1e402 | |
parent | 85e4746be9dda9e2332751141e10db7361dc5466 (diff) |
Handle server death before close().2.0.9
-rw-r--r-- | library.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -777,7 +777,9 @@ PHPAPI int redis_sock_disconnect(RedisSock *redis_sock TSRMLS_DC) redis_sock_write(redis_sock, "QUIT", sizeof("QUIT") - 1 TSRMLS_CC); redis_sock->status = REDIS_SOCK_STATUS_DISCONNECTED; - php_stream_close(redis_sock->stream); + if(redis_sock->stream) { /* still valid after the write? */ + php_stream_close(redis_sock->stream); + } redis_sock->stream = NULL; res = 1; |